Results 1 to 2 of 2
- 08-10-2011, 11:14 PM #1
Java, Reset Visibility Of An Object
How can I make an object disappear when you click a button, then re-appear when you click it again? My current code is:
What did I do wrong? Right now when you click it one time it dissapears, but does not come back when you click it again.Java Code:int i = 0; if(i == 0) { GridPanel.setVisible(false); i++; } else { GridPanel.setVisible(true); Frame.add(GridPanel, BorderLayout.CENTER); Frame.setVisible(true); i = 0; }Last edited by Alerhau; 08-10-2011 at 11:18 PM.
- 08-10-2011, 11:53 PM #2
Similar Threads
-
Help! set dinamically visibility of panels
By unkus_nob in forum JavaFXReplies: 5Last Post: 06-21-2011, 09:06 PM -
What is the lifetime (scope & visibility) of containers and their child objects
By NoSwing in forum AWT / SwingReplies: 0Last Post: 03-13-2011, 03:54 AM -
Java Visibility
By efozdel in forum New To JavaReplies: 8Last Post: 07-07-2010, 03:36 AM -
email servlet ( java.net.SocketException: Connection reset)
By anthrax in forum Advanced JavaReplies: 2Last Post: 01-24-2010, 03:41 PM -
Newbie help on visibility and static final
By tornado in forum New To JavaReplies: 3Last Post: 11-28-2008, 01:32 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks