Results 1 to 3 of 3
- 12-15-2009, 03:57 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 15
- Rep Power
- 0
Checking if a button was pressed in a Window.
I have created an input dialog window that has an OK button to submit information and a cancel button to close the dialog window. I want to know, how do I add an event to the cancel button so when its clicked it goes to one of my if statements that I have in my program?
-
There are several ways to solve this. One way is to give the class that holds the buttons a return value field as well as a getter method. After the dialog returns, query the getter method. I sometimes do this and use an int and borrow the constants from JOptionPane.
- 12-15-2009, 05:28 AM #3
Member
- Join Date
- Sep 2009
- Location
- http://www.kouje.com
- Posts
- 16
- Rep Power
- 0
Similar Threads
-
how to disable minimize and maximize button in jframe window
By santhosh_el in forum AWT / SwingReplies: 6Last Post: 11-22-2010, 11:55 AM -
change url in parent window from child window
By rakesh_n_mehta in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-09-2009, 12:17 PM -
get key pressed
By prashant in forum NetworkingReplies: 1Last Post: 03-26-2009, 09:10 PM -
Waiting for a button to be pressed
By SomeGuyOverThere in forum New To JavaReplies: 6Last Post: 08-21-2008, 09:30 PM -
key pressed event
By kavithas in forum New To JavaReplies: 7Last Post: 12-10-2007, 02:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks