Font.SIZE_LARGE : Font « javax.microedition.lcdui « Java by API






Font.SIZE_LARGE

 


import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.midlet.MIDlet;

public class SystemFontMidlet extends MIDlet {
  public SystemFontMidlet() { // constructor
  }

  public void startApp() {
    Canvas canvas = new FontCanvas();
    Display display = Display.getDisplay(this);
    display.setCurrent(canvas);
  }

  public void pauseApp() {
  }

  public void destroyApp(boolean unconditional) {
  }
}

class FontCanvas extends Canvas {
  public void paint(Graphics g) {
    g.setColor(0xffffff);
    g.fillRect(0, 0, getWidth(), getHeight());
    g.setColor(0x000000);

    g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_LARGE));
    g.drawString("System Font", 0, 0, g.LEFT | g.TOP);
  }
}

   
  








Related examples in the same category

1.Font.FACE_PROPORTIONAL
2.Font.SIZE_MEDIUM
3.Font.STYLE_PLAIN
4.Font.STYLE_UNDERLINED