我创建了一个Dialog
有两个按钮是,否,然后我有动作监听器添加到他们,我的问题是,我想没有按钮来隐藏我已经创建了Dialog
隐藏对话框从里面LWUIT
代码的样子:
dialog = new Dialog(title);
dialog.setDialogType(Dialog.TYPE_CONFIRMATION);
ta = new TextArea(text);
ta.getStyle().setBorder(Border.createEmpty());
ta.setEditable(false);
yesCommand = new Button("YES");
noCommand = new Button("NO");
yesCommand.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
LGBMainMidlet.getLGBMidlet().notifyDestroyed();
}
});
noCommand.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
Logger.Log("Bye Bye");
dialog = null;
System.gc();
}
});
dialog.addComponent(ta);
dialog.addComponent(yesCommand);
dialog.addComponent(noCommand);
dialog.show();
代码不为我工作,谁能告诉我是什么问题?
B.N.我已经使用dialog.dispose()
,但它退出整个应用程序
但是,你想要的是当你按下一个命令或什么时隐藏对话框? – Mun0n 2012-04-08 16:54:33