Bom!
Tentei fazer, só que aparece seguintes erros:
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:324: illegal start of expression
public TextField getNotaNecessaria() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:324: ‘;’ expected
public TextField getNotaNecessaria() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:338: illegal start of expression
public Display getDisplay () {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:338: ‘;’ expected
public Display getDisplay () {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:345: illegal start of expression
public void exitMIDlet() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:345: illegal start of expression
public void exitMIDlet() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:345: ‘;’ expected
public void exitMIDlet() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:355: illegal start of expression
public void startApp() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:355: illegal start of expression
public void startApp() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:355: ‘;’ expected
public void startApp() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:368: illegal start of expression
public void pauseApp() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:368: illegal start of expression
public void pauseApp() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:368: ‘;’ expected
public void pauseApp() {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:376: illegal start of expression
public void destroyApp(boolean unconditional) {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:376: illegal start of expression
public void destroyApp(boolean unconditional) {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:376: ‘;’ expected
public void destroyApp(boolean unconditional) {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:376: ‘;’ expected
public void destroyApp(boolean unconditional) {
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\src\notas\NotaPLPMIDlet.java:379: reached end of file while parsing
}
18 errors
C:\Documents and Settings\Didi\My Documents\NetBeansProjects\NotasPLP\nbproject\build-impl.xml:354: Compile failed; see the compiler error output for details.
FALHA NA CONSTRUÇÃO (tempo total: 0 segundos)
Pq será que está dando esses erros? Tentei achar os erros que ele está falando, mas não consigo encontrar.
Abaixo, segue meu código completo.
package notas;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* @author
*/
public class NotaPLPMIDlet extends MIDlet implements CommandListener {
private boolean midletPaused = false;
Display display=Display.getDisplay(this);
//<editor-fold defaultstate="collapsed" desc=" Generated Fields ">
private Command Saída;
private Command verResultados;
private Command VoltarEntradaDeDados;
private Form EntradadeDados;
private TextField prova1;
private TextField semTrabalhos;
private TextField prova3;
private TextField prova2;
private TextField trabalho2;
private TextField trabalho1;
private Form SaídaDeDados;
private TextField notaNecessaria;
//</editor-fold>
/**
* The NotaPLPMIDlet constructor.
*/
public NotaPLPMIDlet() {
}
public void startMIDlet() {
// write pre-action user code here
switchDisplayable(null, getEntradadeDados());
// write post-action user code here
}
public void resumeMIDlet() {
// write pre-action user code here
// write post-action user code here
}
public void switchDisplayable(Alert alert, Displayable nextDisplayable) {
// write pre-switch user code here
Display display = getDisplay();
if (alert == null) {
display.setCurrent(nextDisplayable);
} else {
display.setCurrent(alert, nextDisplayable);
}
// write post-switch user code here
}
public void commandAction(Command command, Displayable displayable) {
// write pre-action user code here
if (displayable == EntradadeDados) {
if (command == Saída) {
// write pre-action user code here
exitMIDlet();
// write post-action user code here
} else if (command == verResultados) {
// write pre-action user code here
switchDisplayable(null, getSaídaDeDados());
// write post-action user code here
}
} else if (displayable == SaídaDeDados) {
if (command == VoltarEntradaDeDados) {
// write pre-action user code here
switchDisplayable(null, getEntradadeDados());
// write post-action user code here
}
}
// write post-action user code here
}
public Command getSaída() {
if (Saída == null) {
// write pre-init user code here
Saída = new Command("Sair", Command.EXIT, 0);
// write post-init user code here
}
return Saída;
}
public Form getEntradadeDados() {
if (EntradadeDados == null) {
// write pre-init user code here
EntradadeDados = new Form("Notas PLP", new Item[] { getSemTrabalhos(), getProva1(), getProva2(), getProva3(), getTrabalho1(), getTrabalho2() });
EntradadeDados.addCommand(getSaída());
EntradadeDados.addCommand(getVerResultados());
EntradadeDados.setCommandListener(this);
// write post-init user code here
}
return EntradadeDados;
}
public TextField getSemTrabalhos() {
if (semTrabalhos == null) {
// write pre-init user code here
semTrabalhos = new TextField("Digite o n\u00FAmero de trabalhos que n\u00E3o foram entregues:", null, 32, TextField.DECIMAL);
// write post-init user code here
}
return semTrabalhos;
}
public TextField getProva1() {
if (prova1 == null) {
// write pre-init user code here
prova1 = new TextField("Digite a nota na prova 1 (LISP):", null, 32, TextField.DECIMAL);
// write post-init user code here
}
return prova1;
}
public TextField getProva2() {
if (prova2 == null) {
// write pre-init user code here
prova2 = new TextField("Digite a nota na prova 2 (JAVA):", null, 32, TextField.DECIMAL);
// write post-init user code here
}
return prova2;
}
public TextField getProva3() {
if (prova3 == null) {
// write pre-init user code here
prova3 = new TextField("Digite a nota da prova 3 (JAVA):", null, 32, TextField.DECIMAL);
// write post-init user code here
}
return prova3;
}
public TextField getTrabalho1() {
if (trabalho1 == null) {
// write pre-init user code here
trabalho1 = new TextField("Digite a nota do trabalho 1 (PROLOG):", null, 32, TextField.DECIMAL);
// write post-init user code here
}
return trabalho1;
}
public TextField getTrabalho2() {
if (trabalho2 == null) {
// write pre-init user code here
trabalho2 = new TextField("Digite a nota do trabalho 2 - DAMAS - (JAVA):", null, 32, TextField.DECIMAL);
// write post-init user code here
}
return trabalho2;
}
public Command getVerResultados() {
if (verResultados == null) {
// write pre-init user code here
verResultados = new Command("Ok", Command.OK, 0);
// write post-init user code here
}
return verResultados;
}
public Command getVoltarEntradaDeDados() {
if (VoltarEntradaDeDados == null) {
// write pre-init user code here
VoltarEntradaDeDados = new Command("Voltar", Command.SCREEN, 0);
// write post-init user code here
}
return VoltarEntradaDeDados;
}
public Form getSaídaDeDados() {
if (SaídaDeDados == null) {
// write pre-init user code here
SaídaDeDados = new Form("Sua Nota de PLP", new Item[] { getNotaNecessaria() });
SaídaDeDados.addCommand(getVoltarEntradaDeDados());
SaídaDeDados.setCommandListener(this);
// write post-init user code here
}
return SaídaDeDados;
}
public void setaResultadoNoFormSaidaDeDados(){
Form entrada = getEntradaDeDados();
Form saida = getSaidaDeDados();
TextField[] arrayItem = new TextField[entrada.size()-1];
for(int i=1; i<entrada.size(); i++){
arrayItem[i] = (TextField)entrada.get(i);
}
((TextField)saida.get(0)).setString(String.valueOf(somaNota(arrayItem)));
}
public int somaNota(TextField[] arrayItem){
int notaTotal = 0;
for(int i=0; i><arrayItem.length; i++){
notaTotal += Integer.parseInt(arrayItem[i].getString());
}
return notaTotal;
public Display getDisplay () {
return Display.getDisplay(this);
}
public void exitMIDlet() {
switchDisplayable (null, null);
destroyApp(true);
notifyDestroyed();
}
public void startApp() {
if (midletPaused) {
resumeMIDlet ();
} else {
initialize ();
startMIDlet ();
}
midletPaused = false;
}
public void pauseApp() {
midletPaused = true;
}
public void destroyApp(boolean unconditional) {
}
}
Grato desde já,
Ricardo>