public void plus_font_size(Manager parent) { if (parent == null) { return; } for (int index = 0; index < parent.getFieldCount(); index++) { parent.getField(index); if (parent.getField(index) instanceof TextField) { TextField tf = (TextField) parent.getField(index); int ts = tf.getFont().getHeight(); int ns = ts; if (ts <= 14) { ns = 16; } if (ts <= 16 && ts > 14) { ns = 18; } if (ts <= 18 && ts > 16) { ns = 20; } if (ts <= 20 && ts > 18) { ns = 22; } if (ts <= 22 && ts > 20) { ns = 14; } tf.setFont(tf.getFont().derive(tf.getFont().getStyle(), ns)); } } }
public TextField WriteParragraph( Manager parent, String text, net.rim.device.api.ui.Font font, long style) { String alignedtxt = text; TextField tf = new TextField(style); tf.setEditable(false); tf.setFont(font); alignedtxt = alignedtxt.trim(); tf.setText(alignedtxt); tf.setMargin(10, 5, 5, 5); parent.add(tf); return tf; }