Ok, grazie
allora, ho corretti tutti gli errori del codice a parte questi due:
D:\\Programmi\\WTK22\\apps\\Altimeter\\src\\main.java:42: cannot resolve symbol
symbol : method getText ()
location: class javax.microedition.lcdui.TextField
n = get.parseInt(bar.getText());
^
D:\\Programmi\\WTK22\\apps\\Altimeter\\src\\main.java:42: cannot resolve symbol
symbol : variable get
location: class main
n = get.parseInt(bar.getText());
^
2 errors
com.sun.kvem.ktools.ExecutionException
Build failed
Ti posto il codice completo, non riesco a capire come mai da errore..
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class main extends MIDlet implements CommandListener
{
int n;
private Display display;
private Form fmMain;
private Command cmOk;
private Command cmExit;
private TextField bar;
private StringItem test;
public main ()
{
display=Display.getDisplay(this);
cmOk = new Command (\"Ok\", Command.OK,2);
cmExit = new Command (\"Esci\",Command.EXIT,1);
bar = new TextField (\"Pressione:\",\"1013\",4,TextField.NUMERIC);
test= new StringItem (\"Altitudine:\",\"Altitudine:\");
fmMain = new Form(\"Altimetro\");
fmMain.addCommand(cmOk);
fmMain.addCommand(cmExit);
fmMain.append(bar);
fmMain.setCommandListener(this);
}
public void startApp()
{
display.setCurrent (fmMain);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command c, Displayable s)
{
if (c==cmOk)
{
try
{
n = get.parseInt(bar.getText());
}
catch(Exception e) {}
test.setText(\"L'altitudine è di: \" + ((1013-n)/9) + \" \" );
}
}
}
Grazie mille per la tua disponibilità!
Ciao!