Witam.
Co może być nie tak?
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class PierwszyMidlet extends MIDlet implements CommandListener {
Display dis;
public void startApp(){
dis=Display.getDisplay(this);
Plotno p=new Plotno();
Command koniec=new Command("koniec",Command.EXIT,0);
p.addCommand(koniec);
p.setCommandListener(this);
dis.setCurrent(p);
}
public void pauseApp(){}
public void destroyApp(boolean b){}
public void commandAction(Command c,Displayable d) {
if(c.getCommandType()==Command.EXIT){
notifyDestroyed();
}
}
}
class Plotno extends Canvas {
public void paint(Graphics g){
g.setColor(255,255,255);
Form f=new Form("");
g.fillRect(0,0,f.getWidth(), f.getHeight());
g.setColor(255,255,0);
g.fillRoundRect(10,10,f.getWidth()-20, f.getHeight()-10,30,30);
g.setColor(255,0,0);
g.setStrokeStyle(Graphics.DOTTED);
g.drawRoundRect(10,10,f.getWidth()-20, f.getHeight()-10,30,30);
Font cz=new Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_BOLD,Font.SIZE_LARGE);
g.setFont(cz);
g.drawString("Java",50,50,Graphics.LEFT | Graphics.TOP);
}
}
błąd kompilacji:
Project settings saved
Building “Pierwszy”
C:\Documents and Settings\I\j2mewtk\2.5.2\apps\Pierwszy\src\PierwszyMidlet.java:32: cannot find symbol
symbol : class getFont
location: class javax.microedition.lcdui.Font
Font cz=new Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_BOLD,Font.SIZE_LARGE);
^
1 error
com.sun.kvem.ktools.ExecutionException
Build failed