判定倒底點(diǎn)擊了哪個(gè)按鈕?
int s = JOptionPane.showConfirmDialog(null, "確定要提交嗎", "提交", JOptionPane.YES_NO_CANCEL_OPTION);
if (s == 0) {
JOptionPane.showMessageDialog(null, "你點(diǎn)的是確定!");
}
if (s == 1) {
JOptionPane.showMessageDialog(null, "你點(diǎn)的是否!");
}
if (s == 2) {
JOptionPane.showMessageDialog(null, "你點(diǎn)的是取消!");
}
posted on 2007-07-16 23:43 木偶湯 閱讀(416) 評(píng)論(2) 編輯 收藏