Olá pessoal estou iniciando em jme…
estou desenvolvento uma aplicação muito simples pra rodar num palm tx , estou utilizando o netbeans, o jme sdk 3 que baixei do site da sun.
A tarefa do aplicativo é realizar pedidos,
a aplicação deve enviar via http alguns parametros para um servidor web(tomcat) que recebe estes parametros (String) com servlets, a aplicação no servidor por sua vez executa uma Stored procedure e retorna o produto pesquisado, as informações contidas no objeto de retorno são convertidas em string e enviadas como resposta ao cliente (PalmTx) onde o usuário deve incluir este item ao pedido ou pesquisar outro…
a aplicação ja esta funcionando no simulador… testei em vários simuladores que vem junto com o netbeans… o palm suporta cldc 1.1 e midp2
estou usando a jvm da ibm (J9), e um software JAD TO PRC para portar a aplicação, até ai tudo bem o problema é que quando tento abrir a tela no palm não funciona nada… nao me da nem um tipo de exceção ou nada parecido a aplicação simplesmente trava… instalei o aplicativo no meu celular… um lgkf300 es telas funcionam tranquilamente, so não funciona mesmo no palm…
alguém ja utilizou jme para palm e teve sucesso, ou partiram pra totalcros ou alguma outra alternativa por favor me dem uma luz…
meu email é toncarvalho@gmail.com
a aplicação esta funcionando tranquilamente no simulador , realiza as consultas ao banco inicia o pedido, adiciona itens, salva no banco tudo certinho…
acredito que o problema este na maneira como as telas abrem…
desde já agracesco…
segue o código do midlet…
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
package hello;
import javax.microedition.midlet.;
import javax.microedition.lcdui.;
import org.netbeans.microedition.lcdui.SplashScreen;
import org.netbeans.microedition.lcdui.WaitScreen;
import org.netbeans.microedition.util.SimpleCancellableTask;
/**
-
@author developer
*/
public class HelloMIDlet extends MIDlet implements CommandListener, ItemCommandListener {//private String urlServidor = (“http://localhost:8888/com.atual.atualmobile.AtualMobile/WebToMobileServletMensagem?parametro=”);
private String urlServidor = (“http://192.168.2.154:8080/AtualMobile/WebToMobileServletMensagem?acao=consultaProduto¶metro=”);
private boolean midletPaused = false;//<editor-fold defaultstate=“collapsed” desc=" Generated Fields “>
//<editor-fold defaultstate=“collapsed” desc=” Generated Fields ">
private java.util.Hashtable __previousDisplayables = new java.util.Hashtable();
private Command desligar;
private Command exitCommand;
private Command okCommandContagem;
private Command voltarModoOperacao;
private Command okCommandPedidos;
private Command okCommandPesquisar;
private Command cancelCommand;
private Command exitCommand1;
private Command okCommand;
private Command backCommand;
private Command itCommandAdicao;
private Command voltarFormPedidos;
private Command backCommand1;
private Command cancelCommandAddProduto;
private Command idAdicionarProduto;
private Command cancelFinalizar;
private Command commandFinalizarPedido;
private Form formInicial;
private ChoiceGroup rgPOpPesquisa;
private SplashScreen splashScreen;
private Form SelectModoOperacao;
private ImageItem imgPedidos;
private Spacer spacer5;
private ImageItem imageItem1;
private Form formPedidos;
private TextField edtCodProduto;
private TextField edtDadosPedido;
private TextField edtDadosProduto;
private TextField textFieldParametro;
private StringItem btnPesquisar;
private Spacer spacer;
private ChoiceGroup choiceGroupPesquisa;
private Spacer spacer1;
private Spacer spacer3;
private StringItem btnAdicionar;
private Spacer spacer4;
private ImageItem imageItemFinalizarPedido;
private Alert alertProdutoNaoEncontrado;
private WaitScreen waitConsulta;
private Form formContagem;
private TextField textField4;
private StringItem stringItem;
private TextField textField;
private TextField textField1;
private TextField textField2;
private TextField textField3;
private Form formAdicao;
private ImageItem imageConfirmarAdicao;
private TextField edtQuantidade;
private TextField edtObservacao;
private WaitScreen addProduto;
private WaitScreen waitFinalizarPedido;
private Alert alert;
private Alert alertaErroAoFinalizarPedido;
private Image image2;
private Image image;
private Image image3;
private SimpleCancellableTask taskPesquisa;
private SimpleCancellableTask taskAdicionarProduto;
private Image image1;
private SimpleCancellableTask taskFinalizarPedido;
//</editor-fold>
StringBuffer mensagem = new StringBuffer();/**
- The HelloMIDlet constructor.
*/
public HelloMIDlet() {
}
//<editor-fold defaultstate=“collapsed” desc=" Generated Methods ">
/**- Switches a display to previous displayable of the current displayable.
- The <code>display</code> instance is obtain from the <code>getDisplay</code> method.
*/
private void switchToPreviousDisplayable() {
Displayable __currentDisplayable = getDisplay().getCurrent();
if (__currentDisplayable != null) {
Displayable __nextDisplayable = (Displayable) __previousDisplayables.get(__currentDisplayable);
if (__nextDisplayable != null) {
switchDisplayable(null, __nextDisplayable);
}
}
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Method: initialize ">
/**- Initilizes the application.
- It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
*/
private void initialize() {
// write pre-initialize user code here
waitFinalizarPedido = new WaitScreen(getDisplay());
waitFinalizarPedido.setTitle(“Finalizando Pedido”);
waitFinalizarPedido.addCommand(getCancelFinalizar());
waitFinalizarPedido.setCommandListener(this);
waitFinalizarPedido.setImage(getImage());
waitFinalizarPedido.setText(“Aguarde a finaliza\u00E7\u00E3o do pedido”);
waitFinalizarPedido.setTask(getTaskFinalizarPedido());
// write post-initialize user code here
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Method: startMIDlet ">
/**- Performs an action assigned to the Mobile Device - MIDlet Started point.
*/
public void startMIDlet() {
// write pre-action user code here
switchDisplayable(null, getSplashScreen());
// write post-action user code here
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Method: resumeMIDlet ">
/**-
Performs an action assigned to the Mobile Device - MIDlet Resumed point.
*/
public void resumeMIDlet() {
// write pre-action user code here// write post-action user code here
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Method: switchDisplayable ">
/**- Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
- @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
-
@param nextDisplayable the Displayable to be set
*/
public void switchDisplayable(Alert alert, Displayable nextDisplayable) {
// write pre-switch user code here
Display display = getDisplay();
Displayable __currentDisplayable = display.getCurrent();
if (__currentDisplayable != null && nextDisplayable != null) {
__previousDisplayables.put(nextDisplayable, __currentDisplayable);
}
if (alert == null) {
display.setCurrent(nextDisplayable);
} else {
display.setCurrent(alert, nextDisplayable);
}
// write post-switch user code here
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Method: commandAction for Displayables ">
/**-
Called by a system to indicated that a command has been invoked on a particular displayable.
-
@param command the Command that was invoked
-
@param displayable the Displayable where the command was invoked
*/
public void commandAction(Command command, Displayable displayable) {
// write pre-action user code here
if (displayable == SelectModoOperacao) {
if (command == desligar) {
// write pre-action user code here
exitMIDlet();
// write post-action user code here
}
} else if (displayable == addProduto) {
if (command == WaitScreen.FAILURE_COMMAND) {
// write pre-action user code here
switchDisplayable(getAlert(), getAddProduto());
// write post-action user code here
} else if (command == WaitScreen.SUCCESS_COMMAND) {
// write pre-action user code here
switchDisplayable(null, getFormPedidos());
// write post-action user code here
} else if (command == cancelCommandAddProduto) {
// write pre-action user code here
switchToPreviousDisplayable();
// write post-action user code here
}
} else if (displayable == alert) {
if (command == backCommand1) {
// write pre-action user code here
switchDisplayable(null, getFormAdicao());
// write post-action user code here
}
} else if (displayable == alertProdutoNaoEncontrado) {
if (command == backCommand) {
// write pre-action user code here
switchDisplayable(null, getFormPedidos());
// write post-action user code here
} else if (command == exitCommand1) {
// write pre-action user code here
exitMIDlet();
// write post-action user code here
}
} else if (displayable == formAdicao) {
if (command == idAdicionarProduto) {
// write pre-action user code here
switchDisplayable(null, getAddProduto());
// write post-action user code here
} else if (command == voltarFormPedidos) {
// write pre-action user code here
switchDisplayable(null, getFormPedidos());
// write post-action user code here
}
} else if (displayable == formContagem) {
if (command == okCommand) {
// write pre-action user code here
switchDisplayable(null, getSelectModoOperacao());
// write post-action user code here
}
} else if (displayable == formInicial) {
if (command == exitCommand) {
// write pre-action user code here// write post-action user code here }
} else if (displayable == formPedidos) {
if (command == voltarModoOperacao) {
// write pre-action user code here
switchDisplayable(null, getSelectModoOperacao());
// write post-action user code here
}
} else if (displayable == splashScreen) {
if (command == SplashScreen.DISMISS_COMMAND) {
// write pre-action user code here
switchDisplayable(null, getSelectModoOperacao());
// write post-action user code here
}
} else if (displayable == waitConsulta) {
if (command == WaitScreen.FAILURE_COMMAND) {
// write pre-action user code here
switchDisplayable(getAlertProdutoNaoEncontrado(), getWaitConsulta());
// write post-action user code here
} else if (command == WaitScreen.SUCCESS_COMMAND) {
// write pre-action user code here
exibeProduto();
// write post-action user code here
} else if (command == cancelCommand) {
// write pre-action user code here
switchToPreviousDisplayable();
// write post-action user code here
}
} else if (displayable == waitFinalizarPedido) {
if (command == WaitScreen.FAILURE_COMMAND) {
// write pre-action user code here
switchDisplayable(getAlertaErroAoFinalizarPedido(), waitFinalizarPedido);
// write post-action user code here
} else if (command == WaitScreen.SUCCESS_COMMAND) {
// write pre-action user code here
atualizarTelaPedido();
// write post-action user code here
} else if (command == cancelFinalizar) {
// write pre-action user code here
switchToPreviousDisplayable();
// write post-action user code here
}
}
// write post-action user code here
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: exitCommand ">
/**- Returns an initiliazed instance of exitCommand component.
-
@return the initialized component instance
*/
public Command getExitCommand() {
if (exitCommand == null) {
// write pre-init user code here
exitCommand = new Command(“Sair”, Command.EXIT, 0);
// write post-init user code here
}
return exitCommand;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: formInicial ">
/**- Returns an initiliazed instance of formInicial component.
-
@return the initialized component instance
*/
public Form getFormInicial() {
if (formInicial == null) {
// write pre-init user code here
formInicial = new Form(“AtualMobile”, new Item[] { getRgPOpPesquisa() });
formInicial.addCommand(getExitCommand());
formInicial.setCommandListener(this);
// write post-init user code here
}
return formInicial;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: rgPOpPesquisa ">
/**- Returns an initiliazed instance of rgPOpPesquisa component.
-
@return the initialized component instance
*/
public ChoiceGroup getRgPOpPesquisa() {
if (rgPOpPesquisa == null) {
// write pre-init user code here
rgPOpPesquisa = new ChoiceGroup(“Modo de Opera\u00E7\u00E3o:”, Choice.EXCLUSIVE);
rgPOpPesquisa.append(“Pedidos”, null);
rgPOpPesquisa.append(“Contagem de Estoque”, null);
rgPOpPesquisa.setSelectedFlags(new boolean[] { true, false });
rgPOpPesquisa.setFont(0, null);
rgPOpPesquisa.setFont(1, null);
// write post-init user code here
}
return rgPOpPesquisa;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: splashScreen ">
/**- Returns an initiliazed instance of splashScreen component.
-
@return the initialized component instance
*/
public SplashScreen getSplashScreen() {
if (splashScreen == null) {
// write pre-init user code here
splashScreen = new SplashScreen(getDisplay());
splashScreen.setTitle(“Iniciando”);
splashScreen.setCommandListener(this);
splashScreen.setImage(getImage());
splashScreen.setText(“Iniciando”);
// write post-init user code here
}
return splashScreen;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: image ">
/**- Returns an initiliazed instance of image component.
-
@return the initialized component instance
*/
public Image getImage() {
if (image == null) {
// write pre-init user code here
try {
image = Image.createImage("/images/logo_layout.png");
} catch (java.io.IOException e) {
e.printStackTrace();
}
// write post-init user code here
}
return image;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: formPedidos ">
/**-
Returns an initiliazed instance of formPedidos component.
-
@return the initialized component instance
*/
public Form getFormPedidos() {
if (formPedidos == null) {
// write pre-init user code here
formPedidos = new Form(“Pedidos”, new Item[] { getEdtDadosPedido(), getImageItemFinalizarPedido(), getSpacer(), getChoiceGroupPesquisa(), getTextFieldParametro(), getBtnPesquisar(), getSpacer1(), getSpacer3(), getSpacer4(), getEdtCodProduto(), getBtnAdicionar(), getEdtDadosProduto() });
formPedidos.addCommand(getVoltarModoOperacao());
formPedidos.setCommandListener(this);
// write post-init user code here}
return formPedidos;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: voltarModoOperacao ">
/**- Returns an initiliazed instance of voltarModoOperacao component.
-
@return the initialized component instance
*/
public Command getVoltarModoOperacao() {
if (voltarModoOperacao == null) {
// write pre-init user code here
voltarModoOperacao = new Command(“Voltar”, Command.BACK, 0);
// write post-init user code here
}
return voltarModoOperacao;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: spacer ">
/**- Returns an initiliazed instance of spacer component.
-
@return the initialized component instance
*/
public Spacer getSpacer() {
if (spacer == null) {
// write pre-init user code here
spacer = new Spacer(16, 5);
spacer.setPreferredSize(-1, -1);
// write post-init user code here
}
return spacer;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: choiceGroupPesquisa ">
/**- Returns an initiliazed instance of choiceGroupPesquisa component.
-
@return the initialized component instance
*/
public ChoiceGroup getChoiceGroupPesquisa() {
if (choiceGroupPesquisa == null) {
// write pre-init user code here
choiceGroupPesquisa = new ChoiceGroup(“Pesquisar por:”, Choice.EXCLUSIVE);
choiceGroupPesquisa.append(“Codigo do produto”, null);
choiceGroupPesquisa.append(“Ean”, null);
choiceGroupPesquisa.setFitPolicy(Choice.TEXT_WRAP_DEFAULT);
choiceGroupPesquisa.setSelectedFlags(new boolean[] { true, false });
choiceGroupPesquisa.setFont(0, null);
choiceGroupPesquisa.setFont(1, null);
// write post-init user code here
}
return choiceGroupPesquisa;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: textFieldParametro ">
/**- Returns an initiliazed instance of textFieldParametro component.
-
@return the initialized component instance
*/
public TextField getTextFieldParametro() {
if (textFieldParametro == null) {
// write pre-init user code here
textFieldParametro = new TextField(“Parametro:”, null, 50, TextField.ANY);
textFieldParametro.setItemCommandListener(this);
// write post-init user code here
}
return textFieldParametro;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: btnPesquisar ">
/**- Returns an initiliazed instance of btnPesquisar component.
-
@return the initialized component instance
*/
public StringItem getBtnPesquisar() {
if (btnPesquisar == null) {
// write pre-init user code here
btnPesquisar = new StringItem(“Pesquisar”, null, Item.BUTTON);
btnPesquisar.addCommand(getOkCommandPesquisar());
btnPesquisar.setItemCommandListener(this);
btnPesquisar.setDefaultCommand(getOkCommandPesquisar());
// write post-init user code here
}
return btnPesquisar;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Method: commandAction for Items ">
/**-
Called by a system to indicated that a command has been invoked on a particular item.
-
@param command the Command that was invoked
-
@param displayable the Item where the command was invoked
*/
public void commandAction(Command command, Item item) {
// write pre-action user code here
if (item == btnAdicionar) {
if (command == idAdicionarProduto) {
// write pre-action user code here// write post-action user code here } else if (command == itCommandAdicao) { // write pre-action user code here switchDisplayable(null, getFormAdicao()); // write post-action user code here }
} else if (item == btnPesquisar) {
if (command == okCommandPesquisar) {
// write pre-action user code here
switchDisplayable(null, getWaitConsulta());
// write post-action user code here
}
} else if (item == imageConfirmarAdicao) {
if (command == itCommandAdicao) {
// write pre-action user code here
switchDisplayable(null, getAddProduto());
// write post-action user code here
}
} else if (item == imageItem1) {
if (command == okCommandContagem) {
// write pre-action user code here
switchDisplayable(null, getFormContagem());
// write post-action user code here
}
} else if (item == imageItemFinalizarPedido) {
if (command == commandFinalizarPedido) {
// write pre-action user code here
switchDisplayable(null, waitFinalizarPedido);
// write post-action user code here
}
} else if (item == imgPedidos) {
if (command == okCommandPedidos) {
// write pre-action user code here
switchDisplayable(null, getFormPedidos());
// write post-action user code here
}
}
// write post-action user code here
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: okCommandPesquisar ">
/**-
Returns an initiliazed instance of okCommandPesquisar component.
-
@return the initialized component instance
*/
public Command getOkCommandPesquisar() {
if (okCommandPesquisar == null) {
// write pre-init user code here
okCommandPesquisar = new Command(“Pesquisar”, Command.OK, 0);
// write post-init user code here}
return okCommandPesquisar;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: alertProdutoNaoEncontrado ">
/**- Returns an initiliazed instance of alertProdutoNaoEncontrado component.
-
@return the initialized component instance
*/
public Alert getAlertProdutoNaoEncontrado() {
if (alertProdutoNaoEncontrado == null) {
// write pre-init user code here
alertProdutoNaoEncontrado = new Alert(“Aten\u00E7\u00E3o”, “Aten\u00E7\u00E3o produto n\u00E3o encontrado”, getImage(), AlertType.INFO);
alertProdutoNaoEncontrado.addCommand(getExitCommand1());
alertProdutoNaoEncontrado.addCommand(getBackCommand());
alertProdutoNaoEncontrado.setCommandListener(this);
alertProdutoNaoEncontrado.setTimeout(Alert.FOREVER);
// write post-init user code here
}
return alertProdutoNaoEncontrado;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: waitConsulta ">
/**-
Returns an initiliazed instance of waitConsulta component.
-
@return the initialized component instance
*/
public WaitScreen getWaitConsulta() {
if (waitConsulta == null) {
// write pre-init user code here
waitConsulta = new WaitScreen(getDisplay());
waitConsulta.setTitle(“Pesquisando produto”);
waitConsulta.addCommand(getCancelCommand());
waitConsulta.setCommandListener(this);
waitConsulta.setImage(getImage());
waitConsulta.setText(“Aguarde”);
waitConsulta.setTask(getTaskPesquisa());
// write post-init user code here}
return waitConsulta;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: taskPesquisa ">
/**-
Returns an initiliazed instance of taskPesquisa component.
-
@return the initialized component instance
*/
public SimpleCancellableTask getTaskPesquisa() {
if (taskPesquisa == null) {
// write pre-init user code heretaskPesquisa = new SimpleCancellableTask(); taskPesquisa.setExecutable(new org.netbeans.microedition.util.Executable() { public void execute() throws Exception { // write taskAdicionarProduto-execution user code here System.out.println(" ecexutando chamada o servidor remoto"); mensagem.delete(0, mensagem.length()); mensagem.append(textFieldParametro.getString().trim()); mensagem.append("*consultaProdutos"); WebToMobileClientMensagem servidor = new WebToMobileClientMensagem(urlServidor + mensagem.toString()); MobileUtil util = new MobileUtil(); ProdutoDto produto = util.decodeMsgProduto(servidor.mensagem(mensagem.toString())); /*getTableModelProduto().setValue(1, 0, produto.getCodProduto()); getTableModelProduto().setValue(1, 1, produto.getDescProdutoEst()); getTableModelProduto().setValue(1, 2, produto.getSaldoEstoque() + " - " + produto.getCodUnidade()); getTableModelProduto().setValue(1, 3, produto.getValorProduto()); */ StringBuffer resposta = new StringBuffer(); resposta.append("Cod: "); resposta.append(produto.getCodProduto()); resposta.append(" Descrição: "); resposta.append(produto.getDescProdutoEst()); resposta.append("Saldo: "); resposta.append(produto.getSaldoEstoque()); resposta.append(" Und: "); resposta.append(produto.getCodUnidade()); resposta.append(" valor: "); resposta.append(produto.getValorProduto()); edtCodProduto.setString(produto.getCodProduto()); edtDadosProduto.setString(resposta.toString()); } });
// write post-init user code here
}
return taskPesquisa;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: cancelCommand ">
/**- Returns an initiliazed instance of cancelCommand component.
-
@return the initialized component instance
*/
public Command getCancelCommand() {
if (cancelCommand == null) {
// write pre-init user code here
cancelCommand = new Command(“Cancelar”, Command.CANCEL, 0);
// write post-init user code here
}
return cancelCommand;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Method: exibeProduto ">
/**-
Performs an action assigned to the exibeProduto entry-point.
*/
public void exibeProduto() {
// write pre-action user code hereswitchDisplayable(null, getFormPedidos());
// write post-action user code here
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: formContagem ">
/**- Returns an initiliazed instance of formContagem component.
-
@return the initialized component instance
*/
public Form getFormContagem() {
if (formContagem == null) {
// write pre-init user code here
formContagem = new Form(“Contagem de Estoque”, new Item[] { getTextField(), getTextField1(), getTextField2(), getTextField3(), getTextField4(), getStringItem() });
formContagem.addCommand(getOkCommand());
formContagem.setCommandListener(this);
// write post-init user code here
}
return formContagem;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: textField ">
/**- Returns an initiliazed instance of textField component.
-
@return the initialized component instance
*/
public TextField getTextField() {
if (textField == null) {
// write pre-init user code here
textField = new TextField(“Produto”, null, 32, TextField.ANY);
// write post-init user code here
}
return textField;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: textField1 ">
/**- Returns an initiliazed instance of textField1 component.
-
@return the initialized component instance
*/
public TextField getTextField1() {
if (textField1 == null) {
// write pre-init user code here
textField1 = new TextField(“Descri\u00E7\u00E3o”, null, 32, TextField.ANY);
// write post-init user code here
}
return textField1;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: textField2 ">
/**- Returns an initiliazed instance of textField2 component.
-
@return the initialized component instance
*/
public TextField getTextField2() {
if (textField2 == null) {
// write pre-init user code here
textField2 = new TextField(“Valor”, null, 32, TextField.ANY);
// write post-init user code here
}
return textField2;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: textField3 ">
/**- Returns an initiliazed instance of textField3 component.
-
@return the initialized component instance
*/
public TextField getTextField3() {
if (textField3 == null) {
// write pre-init user code here
textField3 = new TextField(“Quantidade”, null, 32, TextField.ANY);
// write post-init user code here
}
return textField3;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: textField4 ">
/**- Returns an initiliazed instance of textField4 component.
-
@return the initialized component instance
*/
public TextField getTextField4() {
if (textField4 == null) {
// write pre-init user code here
textField4 = new TextField(“Observa\u00E7\u00E3o”, null, 32, TextField.ANY);
// write post-init user code here
}
return textField4;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: stringItem ">
/**- Returns an initiliazed instance of stringItem component.
-
@return the initialized component instance
*/
public StringItem getStringItem() {
if (stringItem == null) {
// write pre-init user code here
stringItem = new StringItem(“Adicionar”, null, Item.BUTTON);
stringItem.setItemCommandListener(this);
// write post-init user code here
}
return stringItem;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: okCommand ">
/**- Returns an initiliazed instance of okCommand component.
-
@return the initialized component instance
*/
public Command getOkCommand() {
if (okCommand == null) {
// write pre-init user code here
okCommand = new Command(“Ok”, Command.OK, 0);
// write post-init user code here
}
return okCommand;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: exitCommand1 ">
/**- Returns an initiliazed instance of exitCommand1 component.
-
@return the initialized component instance
*/
public Command getExitCommand1() {
if (exitCommand1 == null) {
// write pre-init user code here
exitCommand1 = new Command(“Sair”, Command.EXIT, 0);
// write post-init user code here
}
return exitCommand1;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: spacer1 ">
/**- Returns an initiliazed instance of spacer1 component.
-
@return the initialized component instance
*/
public Spacer getSpacer1() {
if (spacer1 == null) {
// write pre-init user code here
spacer1 = new Spacer(16, 1);
// write post-init user code here
}
return spacer1;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: backCommand ">
/**- Returns an initiliazed instance of backCommand component.
-
@return the initialized component instance
*/
public Command getBackCommand() {
if (backCommand == null) {
// write pre-init user code here
backCommand = new Command(“Voltar”, Command.BACK, 0);
// write post-init user code here
}
return backCommand;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: formAdicao ">
/**- Returns an initiliazed instance of formAdicao component.
-
@return the initialized component instance
*/
public Form getFormAdicao() {
if (formAdicao == null) {
// write pre-init user code here
formAdicao = new Form(“Adicionando Produtos”, new Item[] { getEdtQuantidade(), getEdtObservacao(), getImageConfirmarAdicao() });
formAdicao.addCommand(getVoltarFormPedidos());
formAdicao.addCommand(getIdAdicionarProduto());
formAdicao.setCommandListener(this);
// write post-init user code here
}
return formAdicao;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: spacer3 ">
/**- Returns an initiliazed instance of spacer3 component.
-
@return the initialized component instance
*/
public Spacer getSpacer3() {
if (spacer3 == null) {
// write pre-init user code here
spacer3 = new Spacer(16, 1);
// write post-init user code here
}
return spacer3;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: spacer4 ">
/**- Returns an initiliazed instance of spacer4 component.
-
@return the initialized component instance
*/
public Spacer getSpacer4() {
if (spacer4 == null) {
// write pre-init user code here
spacer4 = new Spacer(16, 1);
// write post-init user code here
}
return spacer4;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: voltarFormPedidos ">
/**- Returns an initiliazed instance of voltarFormPedidos component.
-
@return the initialized component instance
*/
public Command getVoltarFormPedidos() {
if (voltarFormPedidos == null) {
// write pre-init user code here
voltarFormPedidos = new Command(“Voltar”, Command.BACK, 0);
// write post-init user code here
}
return voltarFormPedidos;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: btnAdicionar ">
/**- Returns an initiliazed instance of btnAdicionar component.
-
@return the initialized component instance
*/
public StringItem getBtnAdicionar() {
if (btnAdicionar == null) {
// write pre-init user code here
btnAdicionar = new StringItem(“Adicionar”, null, Item.BUTTON);
btnAdicionar.addCommand(getItCommandAdicao());
btnAdicionar.addCommand(getIdAdicionarProduto());
btnAdicionar.setItemCommandListener(this);
btnAdicionar.setDefaultCommand(getItCommandAdicao());
// write post-init user code here
}
return btnAdicionar;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: itCommandAdicao ">
/**- Returns an initiliazed instance of itCommandAdicao component.
-
@return the initialized component instance
*/
public Command getItCommandAdicao() {
if (itCommandAdicao == null) {
// write pre-init user code here
itCommandAdicao = new Command(“Adicionar”, Command.ITEM, 0);
// write post-init user code here
}
return itCommandAdicao;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: edtQuantidade ">
/**- Returns an initiliazed instance of edtQuantidade component.
-
@return the initialized component instance
*/
public TextField getEdtQuantidade() {
if (edtQuantidade == null) {
// write pre-init user code here
edtQuantidade = new TextField(“Quantidade”, null, 100, TextField.NUMERIC);
edtQuantidade.setLayout(ImageItem.LAYOUT_DEFAULT);
// write post-init user code here
}
return edtQuantidade;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: edtObservacao ">
/**- Returns an initiliazed instance of edtObservacao component.
-
@return the initialized component instance
*/
public TextField getEdtObservacao() {
if (edtObservacao == null) {
// write pre-init user code here
edtObservacao = new TextField(“Observa\u00E7\u00E3o”, null, 32, TextField.ANY);
// write post-init user code here
}
return edtObservacao;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: addProduto ">
/**- Returns an initiliazed instance of addProduto component.
-
@return the initialized component instance
*/
public WaitScreen getAddProduto() {
if (addProduto == null) {
// write pre-init user code here
addProduto = new WaitScreen(getDisplay());
addProduto.setTitle(“Adicionando produto”);
addProduto.addCommand(getCancelCommandAddProduto());
addProduto.setCommandListener(this);
addProduto.setFullScreenMode(true);
addProduto.setImage(getImage());
addProduto.setText(“Aguardando acesso ao banco de dados”);
addProduto.setTask(getTaskAdicionarProduto());
// write post-init user code here
}
return addProduto;
}
//</editor-fold>
//<editor-fold defaultstate=“collapsed” desc=" Generated Getter: taskAdicionarProduto ">
/**-
Returns an initiliazed instance of taskAdicionarProduto component.
-
@return the initialized component instance
*/
public SimpleCancellableTask getTaskAdicionarProduto() {
if (taskAdicionarProduto == null) {
// write pre-init user code here
taskAdicionarProduto = new SimpleCancellableTask();
taskAdicionarProduto.setExecutable(new org.netbeans.microedition.util.Executable() {
public void execute() throws Exception {
// write taskAdicionarProduto-execution user code here
// write taskAdicionarProduto-execution use r code here
try {
System.out.println(" executando a tarefa: TaskAdicionarProduto");mensagem.delete(0, mensagem.length()); mensagem.append("*"); mensagem.append(textFieldParametro.getString()); mensagem.append("*"); mensagem.append("addProduto"); mensagem.append("*"); // mensagem.append("codigo_do_pedido");
- The HelloMIDlet constructor.
/*
String[][] texto = getTableModelPedido().getValues();
String linha0C0 = texto[0][0];
String linha0C1 = texto[0][1];
String linha0C2 = texto[0][2];*/
//System.out.println("colunas:" + codPedido + " 2 " + linha0C1 + " 3 " + linha0C2);
System.out.println(" dados no edtDadosPedido:" + edtDadosPedido.getLabel());
String codPedido = null;
try {
StringTokenizer tkPedido = new StringTokenizer(edtDadosPedido.getLabel(), ":");
if (tkPedido.hasMoreTokens()) {
codPedido = tkPedido.nextToken();
}
} catch (Exception e) {
e.printStackTrace();
}
mensagem.append(codPedido);
mensagem.append("*");
// mensagem.append("quantidade");
mensagem.append(edtQuantidade.getString());
mensagem.append("*");
//mensagem.append("observacao");
mensagem.append(edtObservacao.getString());
System.out.println("string enviada ao servidor: " + mensagem.toString());
WebToMobileClientMensagem servidor = new WebToMobileClientMensagem(urlServidor + mensagem.toString());
//String resultado = servidor.getServletInfo();
// System.out.println( servidor.mensagem(mensagem.toString()));
MobileUtil util = new MobileUtil();
PedidoDto pedido = util.decodeMsgPedido(servidor.mensagem(mensagem.toString()));
System.out.println("pedido retorno:" + pedido.getCodPedido() + " status: " + pedido.getStatusPedido() + " Tipo:" + pedido.getTipo());
/* getTableModelPedido().setValue(0, 0, pedido.getCodPedido());
getTableModelPedido().setValue(1, 0, pedido.getQtdItens());
getTableModelPedido().setValue(2, 0, pedido.getStatusPedido());
*/
edtDadosPedido.setString("Itens:" + pedido.getQtdItens() + " Status: " + pedido.getStatusPedido());
edtDadosPedido.setLabel(pedido.getCodPedido());
} catch (Exception e) {
e.printStackTrace();
}
}
});
// write post-init user code here
}
return taskAdicionarProduto;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: idAdicionarProduto ">
/**
* Returns an initiliazed instance of idAdicionarProduto component.
* @return the initialized component instance
*/
public Command getIdAdicionarProduto() {
if (idAdicionarProduto == null) {
// write pre-init user code here
idAdicionarProduto = new Command("Item", Command.ITEM, 0);
// write post-init user code here
}
return idAdicionarProduto;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: cancelCommandAddProduto ">
/**
* Returns an initiliazed instance of cancelCommandAddProduto component.
* @return the initialized component instance
*/
public Command getCancelCommandAddProduto() {
if (cancelCommandAddProduto == null) {
// write pre-init user code here
cancelCommandAddProduto = new Command("Cancelar", Command.CANCEL, 0);
// write post-init user code here
}
return cancelCommandAddProduto;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: alert ">
/**
* Returns an initiliazed instance of alert component.
* @return the initialized component instance
*/
public Alert getAlert() {
if (alert == null) {
// write pre-init user code here
alert = new Alert("Erro adicionando produto", "cancelando opera\u00E7\u00E3o", getImage(), null);
alert.addCommand(getBackCommand1());
alert.setCommandListener(this);
alert.setTimeout(Alert.FOREVER);
// write post-init user code here
}
return alert;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand1 ">
/**
* Returns an initiliazed instance of backCommand1 component.
* @return the initialized component instance
*/
public Command getBackCommand1() {
if (backCommand1 == null) {
// write pre-init user code here
backCommand1 = new Command("Voltar", Command.BACK, 0);
// write post-init user code here
}
return backCommand1;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: taskFinalizarPedido ">
/**
* Returns an initiliazed instance of taskFinalizarPedido component.
* @return the initialized component instance
*/
public SimpleCancellableTask getTaskFinalizarPedido() {
if (taskFinalizarPedido == null) {
// write pre-init user code here
taskFinalizarPedido = new SimpleCancellableTask();
taskFinalizarPedido.setExecutable(new org.netbeans.microedition.util.Executable() {
public void execute() throws Exception {
// write task-execution user code here
System.out.println("executando a tarefa finalizar pedido");
try {
mensagem.delete(0, mensagem.length());
// mensagem.append("codigo_do_pedido");
String codPedido = null;
StringTokenizer tkPedido = new StringTokenizer(edtDadosPedido.getLabel(), ":");
if (tkPedido.hasMoreTokens()) {
codPedido = tkPedido.nextToken();
}
/*
String[][] texto = getTableModelPedido().getValues();
codPedido = texto[0][0];*/
mensagem.append("*");
mensagem.append(codPedido);
mensagem.append("*");
mensagem.append("finalizarPedido");
System.out.println("string enviada ao servidor: " + mensagem.toString());
WebToMobileClientMensagem servidor = new WebToMobileClientMensagem(urlServidor + mensagem.toString());
MobileUtil util = new MobileUtil();
PedidoDto pedido = util.decodeMsgPedido(servidor.mensagem(mensagem.toString()));
System.out.println("pedido retorno:" + pedido.getCodPedido() + " status: " + pedido.getStatusPedido() + " Tipo:" + pedido.getTipo());
/*getTableModelPedido().setValue(0, 0, pedido.getCodPedido());
getTableModelPedido().setValue(1, 0, pedido.getQtdItens());
getTableModelPedido().setValue(2, 0, pedido.getStatusPedido());*/
edtDadosPedido.setString("Cod:" + pedido.getCodPedido() + " Itens:" + pedido.getQtdItens() + " Status: " + pedido.getStatusPedido());
} catch (Exception e) {
e.printStackTrace();
}
}
});
// write post-init user code here
}
return taskFinalizarPedido;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertaErroAoFinalizarPedido ">
/**
* Returns an initiliazed instance of alertaErroAoFinalizarPedido component.
* @return the initialized component instance
*/
public Alert getAlertaErroAoFinalizarPedido() {
if (alertaErroAoFinalizarPedido == null) {
// write pre-init user code here
alertaErroAoFinalizarPedido = new Alert("Erro ao finalizar pedido", "Aten\u00E7\u00E3o houve um erro ao finalizar o pedido", getImage(), null);
alertaErroAoFinalizarPedido.setTimeout(Alert.FOREVER);
// write post-init user code here
}
return alertaErroAoFinalizarPedido;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: commandFinalizarPedido ">
/**
* Returns an initiliazed instance of commandFinalizarPedido component.
* @return the initialized component instance
*/
public Command getCommandFinalizarPedido() {
if (commandFinalizarPedido == null) {
// write pre-init user code here
commandFinalizarPedido = new Command("Finalizar Pedido", Command.ITEM, 0);
// write post-init user code here
}
return commandFinalizarPedido;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItemFinalizarPedido ">
/**
* Returns an initiliazed instance of imageItemFinalizarPedido component.
* @return the initialized component instance
*/
public ImageItem getImageItemFinalizarPedido() {
if (imageItemFinalizarPedido == null) {
// write pre-init user code here
imageItemFinalizarPedido = new ImageItem("Finalizar pedido", getImage1(), ImageItem.LAYOUT_DEFAULT, "", Item.HYPERLINK);
imageItemFinalizarPedido.addCommand(getCommandFinalizarPedido());
imageItemFinalizarPedido.setItemCommandListener(this);
imageItemFinalizarPedido.setDefaultCommand(getCommandFinalizarPedido());
// write post-init user code here
}
return imageItemFinalizarPedido;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: image1 ">
/**
* Returns an initiliazed instance of image1 component.
* @return the initialized component instance
*/
public Image getImage1() {
if (image1 == null) {
// write pre-init user code here
try {
image1 = Image.createImage("/ok_24x24.png");
} catch (java.io.IOException e) {
e.printStackTrace();
}
// write post-init user code here
}
return image1;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: cancelFinalizar ">
/**
* Returns an initiliazed instance of cancelFinalizar component.
* @return the initialized component instance
*/
public Command getCancelFinalizar() {
if (cancelFinalizar == null) {
// write pre-init user code here
cancelFinalizar = new Command("Cancelar", Command.CANCEL, 0);
// write post-init user code here
}
return cancelFinalizar;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageConfirmarAdicao ">
/**
* Returns an initiliazed instance of imageConfirmarAdicao component.
* @return the initialized component instance
*/
public ImageItem getImageConfirmarAdicao() {
if (imageConfirmarAdicao == null) {
// write pre-init user code here
imageConfirmarAdicao = new ImageItem("Confirmar", getImage1(), ImageItem.LAYOUT_DEFAULT, "Confirmar", Item.HYPERLINK);
imageConfirmarAdicao.addCommand(getItCommandAdicao());
imageConfirmarAdicao.setItemCommandListener(this);
imageConfirmarAdicao.setDefaultCommand(getItCommandAdicao());
// write post-init user code here
}
return imageConfirmarAdicao;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Method: atualizarTelaPedido ">
/**
* Performs an action assigned to the atualizarTelaPedido entry-point.
*/
public void atualizarTelaPedido() {
//String[][] values = new java.lang.String[][]{new java.lang.String[]{"0", "0", "Novo"}};
edtDadosPedido.setString("Itens:0 Status:Novo");
edtDadosPedido.setLabel(":0");
switchDisplayable(null, getFormPedidos());
// write post-action user code here
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: image2 ">
/**
* Returns an initiliazed instance of image2 component.
* @return the initialized component instance
*/
public Image getImage2() {
if (image2 == null) {
// write pre-init user code here
try {
image2 = Image.createImage("/pedido2.png");
} catch (java.io.IOException e) {
e.printStackTrace();
}
// write post-init user code here
}
return image2;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: SelectModoOperacao ">
/**
* Returns an initiliazed instance of SelectModoOperacao component.
* @return the initialized component instance
*/
public Form getSelectModoOperacao() {
if (SelectModoOperacao == null) {
// write pre-init user code here
SelectModoOperacao = new Form("Selecione o modo de opera\u00E7\u00E3o", new Item[] { getImgPedidos(), getSpacer5(), getImageItem1() });
SelectModoOperacao.addCommand(getDesligar());
SelectModoOperacao.setCommandListener(this);
// write post-init user code here
}
return SelectModoOperacao;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: imgPedidos ">
/**
* Returns an initiliazed instance of imgPedidos component.
* @return the initialized component instance
*/
public ImageItem getImgPedidos() {
if (imgPedidos == null) {
// write pre-init user code here
imgPedidos = new ImageItem("Pedidos", getImage2(), ImageItem.LAYOUT_DEFAULT, "Pedidos", Item.HYPERLINK);
imgPedidos.addCommand(getOkCommandPedidos());
imgPedidos.setItemCommandListener(this);
imgPedidos.setDefaultCommand(getOkCommandPedidos());
// write post-init user code here
}
return imgPedidos;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: desligar ">
/**
* Returns an initiliazed instance of desligar component.
* @return the initialized component instance
*/
public Command getDesligar() {
if (desligar == null) {
// write pre-init user code here
desligar = new Command("Sair", Command.EXIT, 0);
// write post-init user code here
}
return desligar;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: spacer5 ">
/**
* Returns an initiliazed instance of spacer5 component.
* @return the initialized component instance
*/
public Spacer getSpacer5() {
if (spacer5 == null) {
// write pre-init user code here
spacer5 = new Spacer(16, 5);
// write post-init user code here
}
return spacer5;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem1 ">
/**
* Returns an initiliazed instance of imageItem1 component.
* @return the initialized component instance
*/
public ImageItem getImageItem1() {
if (imageItem1 == null) {
// write pre-init user code here
imageItem1 = new ImageItem("Estoque", getImage3(), ImageItem.LAYOUT_DEFAULT, "<Imagem perdida>", Item.HYPERLINK);
imageItem1.addCommand(getOkCommandContagem());
imageItem1.setItemCommandListener(this);
imageItem1.setDefaultCommand(getOkCommandContagem());
// write post-init user code here
}
return imageItem1;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: image3 ">
/**
* Returns an initiliazed instance of image3 component.
* @return the initialized component instance
*/
public Image getImage3() {
if (image3 == null) {
// write pre-init user code here
try {
image3 = Image.createImage("/images/pedido1.png");
} catch (java.io.IOException e) {
e.printStackTrace();
}
// write post-init user code here
}
return image3;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommandPedidos ">
/**
* Returns an initiliazed instance of okCommandPedidos component.
* @return the initialized component instance
*/
public Command getOkCommandPedidos() {
if (okCommandPedidos == null) {
// write pre-init user code here
okCommandPedidos = new Command("Pedidos", Command.OK, 0);
// write post-init user code here
}
return okCommandPedidos;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommandContagem ">
/**
* Returns an initiliazed instance of okCommandContagem component.
* @return the initialized component instance
*/
public Command getOkCommandContagem() {
if (okCommandContagem == null) {
// write pre-init user code here
okCommandContagem = new Command("Contagem", Command.OK, 0);
// write post-init user code here
}
return okCommandContagem;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: edtDadosPedido ">
/**
* Returns an initiliazed instance of edtDadosPedido component.
* @return the initialized component instance
*/
public TextField getEdtDadosPedido() {
if (edtDadosPedido == null) {
// write pre-init user code here
edtDadosPedido = new TextField(":0", "Itens: 0 Status: Aberto", 200, TextField.ANY);
// write post-init user code here
}
return edtDadosPedido;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: edtCodProduto ">
/**
* Returns an initiliazed instance of edtCodProduto component.
* @return the initialized component instance
*/
public TextField getEdtCodProduto() {
if (edtCodProduto == null) {
// write pre-init user code here
edtCodProduto = new TextField("Produto", "0", 100, TextField.ANY);
// write post-init user code here
}
return edtCodProduto;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: edtDadosProduto ">
/**
* Returns an initiliazed instance of edtDadosProduto component.
* @return the initialized component instance
*/
public TextField getEdtDadosProduto() {
if (edtDadosProduto == null) {
// write pre-init user code here
edtDadosProduto = new TextField("Dados do Produto", "C\u00F3digo: 0 Descricao: ", 500, TextField.ANY);
// write post-init user code here
}
return edtDadosProduto;
}
//</editor-fold>
/**
* Returns a display instance.
* @return the display instance.
*/
public Display getDisplay() {
return Display.getDisplay(this);
}
/**
* Exits MIDlet.
*/
public void exitMIDlet() {
switchDisplayable(null, null);
destroyApp(true);
notifyDestroyed();
}
/**
* Called when MIDlet is started.
* Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
*/
public void startApp() {
if (midletPaused) {
resumeMIDlet();
} else {
initialize();
startMIDlet();
}
midletPaused = false;
}
/**
* Called when MIDlet is paused.
*/
public void pauseApp() {
midletPaused = true;
}
/**
* Called to signal the MIDlet to terminate.
* @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
*/
public void destroyApp(boolean unconditional) {
}
}