Closing a dialog created by JOptionPane.showOptionDialog()

I am creating an options dialog using `JOptionPane.showOptionDialog(...)`; For the options parameter I am passing an array of JButtons each with its own `ActionListener`. One of these buttons is responsible for closing the dialog. My question is: what code do I place in the close button's event handler to close the option dialog? A point that may make a difference: the class responsible for showing this dialog is a singleton and, as such, the method responsible for displaying the dialog is *static*. Therefore, calling `javax.swing.JInternalFrame.doDefaultCloseAction();` does not work "from a static context". Thanks

以上就是Closing a dialog created by JOptionPane.showOptionDialog()的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准