Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Handle Events for JOptionPane buttons?

807589Oct 24 2008 — edited Oct 24 2008
Hi All,

I need a help...

I am trying to develop a simple SWING application that consists of multiple elements (mainly text fields) and a Submit button. On pressing Submit button, it should validate all the fields and then do something else. But if some fields are left blank, then it should give a pop-up message and on clicking the OK button on the pop-up message, the focus should go to that text field which is left null.

The problem is I am not able to understand how to Capture this OK button click-event of the pop-up message. I mean how to do something when the OK/Cancle button of the pop-up window is clicked.

Please Help me.

Thanks in Advance,
Ujjal
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2008
Added on Oct 24 2008
11 comments
2,141 views