Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 8th, 2005, 10:18 AM   #1
freddielj
Newbie
 
Join Date: Mar 2005
Posts: 18
Rep Power: 0 freddielj is on a distinguished road
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();
^
freddielj is offline   Reply With Quote
Old Apr 8th, 2005, 11:02 AM   #2
xavier
Professional Programmer
 
xavier's Avatar
 
Join Date: Oct 2004
Location: .ro
Posts: 381
Rep Power: 4 xavier is on a distinguished road
Send a message via Yahoo to xavier
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!!");
should probably look like :
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 !
xavier is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:40 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC