java - How can you set an actionlistener on the ok option of a jdialog? -


Hi, I want to trigger some action when jdialog's OK button is pressed, I know that you can do this

  int rep = JOptionPane.showConfirmDialog (null, pangesfac, "gestion des chambres a facturer", joptionpan. Okancalaya OPTION, joppenpain.pLAIN_MESSAGE); If (rep == JOptionPane.OK_OPTION) {// to take action}   

But in my case, I want an external controller to take care of those things (my code by MVC Is structured) when the OK button is pressed. So how can you install an action listener on the right button?

It is possible but it is not possible to add an ActionListener on the OK button Using PropertyChangeListener.

An example is shown on this page:

However, you may want to reconsider your design, without having to capture the event, even after passing the results from the resolution pen to your controller. You can.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -