import javax.microedition.lcdui.*; public class Run extends Canvas implements Runnable { int width, height; static Run runI; String text = "Заголовок"; Image i; Graphics graph; Util util; Run () { runI = this; width = getWidth(); height = getHeight(); setFullScreenMode(true); i = Image.createImage(width, height); graph = i.getGraphics(); util = new Util(); Thread thread = new Thread(); thread.start(); } void run () { cls(); title(); repaint(); } void paint (Graphics instance) { instance.drawImage(i, 0, 0, 20); } /*---*/ void keyPressed (int key) { switch (key) { case Canvas.KEY_NUM5: Main.main.exit(); } } void keyReleased (int key) {} void title () { graph.setColor(60, 60, 60); graph.fillRect(0, 0, width, height/8); graph.setColor(255,255,255); graph.drawString(text, util.hcenter(text), util.vcenter(height/8), 20); } void cls () { graph.setColor(255,255, 255); graph.fillRect(0, 0, width, height); } }