My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 70 attachment: Midlet.java (889 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

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

public class Midlet extends MIDlet {
public void startApp() {
Display display = Display.getDisplay(this);
display.setCurrent(new MyCanvas());
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}

class MyCanvas extends Canvas {

protected void paint(Graphics g) {
Image im = Image.createImage(100, 100);

Graphics g2 = im.getGraphics();
g2.translate(10, 10);
g2 = im.getGraphics();
g2.drawString("TEST", 0, 0, Graphics.LEFT | Graphics.TOP);

g.drawImage(im, 0, 0, Graphics.LEFT | Graphics.TOP);
}

}
}
Powered by Google Project Hosting