How hide/remove all added JPanel in a JInternalFrame
Hi,
i got a problem
i have added 4 or 5 JPanel to the JinternalFrame
i want just 1 Jpanel should be in visible at a time.
i don't want to use setVisible(false) for every JPanel to hide them
can I hide all the JPanels with a single method and make visible the only one Panel which i want now
is it possible?
What abt removeAll() in JInternalFrame?
suggestions plssssssss.......
thank you
--Subbu
Message was edited by:
Subbu_java
# 2
thanks for the quick reply.
but i tried with removeAll() that's removing all the components in the InternalFrame. Also, after that we are not able to see any panels.
you said that, remove the panels which i don't want to show
you mean hiding them are removing them from InternalFrame.
Subbu
# 3
Remove all and add the one you want?
Or set all invisible and show the one you want?
Another suggestion of mine would be making an "interface" for the panel, like:
JPanel interfacePanel;
interfacePanel=defaultPanel;
mainPanel.add(interfacePanel);
when you want to change:
mainPanel.remove(interfacePanel);
interfacePanel=newPanel;
mainPanel.add(interfacePanel);
mainPanel.revalidate();