
-----------------------------------
Regeane
Thu Jun 01, 2006 3:00 pm

Frame Closing
-----------------------------------
Is there a way to have the frame close [or be setVisible(false)] when a button is pressed if the actionPerformed method is not in the same class as the frame was first initialized?

-----------------------------------
rizzix
Thu Jun 01, 2006 3:58 pm


-----------------------------------
hmm.. yea.. as long as you have  a reference to that frame.. you can do anything to it..

-----------------------------------
Regeane
Thu Jun 01, 2006 4:48 pm


-----------------------------------
Hmm... how would one go about getting a reference??

-----------------------------------
GodofOsiris
Mon Jun 19, 2006 2:25 pm


-----------------------------------
All you would have to do in the actionPerformed method is when the buttons clicked use this line of code

System.exit(0);

-----------------------------------
[Gandalf]
Mon Jun 19, 2006 4:39 pm


-----------------------------------
No need to reply to 2 month old topics.  Read the rules found [url=http://www.compsci.ca/v2/viewtopic.php?t=3151]here, specifically the last one about necro posting.
