我創建了一個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