Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Frame Closing
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Regeane




PostPosted: Thu Jun 01, 2006 3:00 pm   Post subject: 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?
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Thu Jun 01, 2006 3:58 pm   Post subject: (No subject)

hmm.. yea.. as long as you have a reference to that frame.. you can do anything to it..
Regeane




PostPosted: Thu Jun 01, 2006 4:48 pm   Post subject: (No subject)

Hmm... how would one go about getting a reference??
GodofOsiris




PostPosted: Mon Jun 19, 2006 2:25 pm   Post subject: (No subject)

All you would have to do in the actionPerformed method is when the buttons clicked use this line of code

code:
System.exit(0);
[Gandalf]




PostPosted: Mon Jun 19, 2006 4:39 pm   Post subject: (No subject)

No need to reply to 2 month old topics. Read the rules found here, specifically the last one about necro posting.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: