This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Refresh with fresh components in a JFrame at Runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Refresh with fresh components in a JFrame at Runtime" Watch "Refresh with fresh components in a JFrame at Runtime" New topic
Author

Refresh with fresh components in a JFrame at Runtime

ritesh r
Greenhorn

Joined: Jul 19, 2001
Posts: 24
Hi All:
I want a immediate solution to a problem .
I am unable to hide or remove the componets.
Let me elaborate:
I have a menubar with Add Issue & view Issue as SubItems with ItemListeners enabled.
Now I am facing a problem.Both these Menuitems are different methods developed by me to handle the laying of these components.
Whenever I click the Add Issue,the addDisplay() method is fired and the components laid out.
Now when I click the View Issue,the ViewDisplay() method is fired,but the components are overlapped.
Help me.Does swing support a functionality where the components are hidden and enabled when clickedd.
Regards
Ritesh
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

You might try
myComponent.setVisible(boolean)??
This hides and shows the component without actually disposing of it.

GenRocket - Experts at Building Test Data
 
 
subject: Refresh with fresh components in a JFrame at Runtime
 
Similar Threads
How to embed a JApplet in Web-Browser
how to move to previous record
Ajax and JSF
Refresh of Jframe with new components at Runtime upon clicking a JMenuBar
How to add events using javascript?