final boolean confirmFlag[] = new boolean[]{false};
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Object[] options = { "确定", "取消" };
int response = JOptionPane.showOptionDialog(PosMain.this, mergeMsg.toString(), "提示",
JOptionPane.YES_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]);
if (response == 0) confirmFlag[0] = true;
}
});
巧妙使用数组,内部匿名类改变外部类final对象值
最新推荐文章于 2021-03-18 15:38:37 发布