![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Posts: 18
Rep Power: 0
![]() |
Errors in microjava midlet
Here are errors i am having any help would be great
import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class GraphicalCanvas { public GraphicalCanvas(Display d) { Display = d; // save the display graphicalObject = new VerticalScrollingTextObject (this, "Hello Midlet World!!"); height = this.getHeight(); width = this.getWidth(); } protected void paint(Graphics g) { g.setColor(255,255,255); g.fillRect(0,0,width,height); graphicalObject.paint(g); } void start() { display.setCurrent(this); Thread t = new Thread(graphicalObject); t.start(); repaint(); } } C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:9: cannot find symbol symbol : variable Display location: class GraphicalCanvas Display = d; // save the display ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:11: cannot find symbol symbol : variable graphicalObject location: class GraphicalCanvas graphicalObject = ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:12: cannot find symbol symbol : class VerticalScrollingTextObject location: class GraphicalCanvas new VerticalScrollingTextObject (this, "Hello Midlet World!!"); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:13: cannot find symbol symbol : variable height location: class GraphicalCanvas height = this.getHeight(); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:13: cannot find symbol symbol : method getHeight() location: class GraphicalCanvas height = this.getHeight(); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:14: cannot find symbol symbol : variable width location: class GraphicalCanvas width = this.getWidth(); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:14: cannot find symbol symbol : method getWidth() location: class GraphicalCanvas width = this.getWidth(); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:20: cannot find symbol symbol : variable width location: class GraphicalCanvas g.fillRect(0,0,width,height); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:20: cannot find symbol symbol : variable height location: class GraphicalCanvas g.fillRect(0,0,width,height); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:21: cannot find symbol symbol : variable graphicalObject location: class GraphicalCanvas graphicalObject.paint(g); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:26: cannot find symbol symbol : variable display location: class GraphicalCanvas display.setCurrent(this); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:27: cannot find symbol symbol : variable graphicalObject location: class GraphicalCanvas Thread t = new Thread(graphicalObject); ^ C:\SonyEricsson\J2ME_SDK\PC_Emulation\WTK2\apps\demo2\src\GraphicalCanvas.java:29: cannot find symbol symbol : method repaint() location: class GraphicalCanvas repaint(); ^ |
|
|
|
|
|
#2 |
|
Professional Programmer
|
Am not an expert or anything so i may be wrong.
What is Display? .. maybe u forgot an import of some sort. Also graphicalObject = new VerticalScrollingTextObject (this, "Hello Midlet World!!"); VerticalScrollingTextObject graphicalObject = new VerticalScrollingTextObject (this, "Hello Midlet World!!"); I tend to belive that u may have forgotten some import cause repaint doesn't work as well... Maybe java.awt or java.avt.event .. I never worked in microjava so i'm just guessing just my 2 penys ![]()
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|