I want to make an internal frame in the main frame and when a button in the main frame pressed, it should hide the internal frame and another internal frame should visible in the same position of first internal frame
Asked
Active
Viewed 266 times
0
-
[CardLayout](https://stackoverflow.com/a/46013230/3992939) may give you a solution for the functionality you want. – c0der Aug 12 '18 at 09:50
-
cardLayout is hard to use with swing (as I am working in netbeans) – Arun B R Aug 12 '18 at 12:21
-
As hard as using any layout manager. Copy paste the example in the link and run it. – c0der Aug 12 '18 at 12:24
-
Its working with simple java class.Then, how to use it with java swing (in an event like button pressed) ? – Arun B R Aug 12 '18 at 12:28
-
It is a simple java class and it uses swing. I added a button. Hope it helps. – c0der Aug 12 '18 at 12:51
1 Answers
0
I want to make an internal frame in the main frame
A JInternalFrame is added to a JDesktopPane.
So you just make the first internal frame invisible and add the second internal frame and make it visible. Or you just make the second internal frame the active frame and it will paint on top of the other frame.
Read the swing tutorial on How to Use Internal Frames for more information and working examples.
If you are not talking about a JInternalFrame, then fix your question and make sure you use proper terminology (ie class name) when you ask a question so we don't have to guess what you are talking about.

camickr
- 321,443
- 19
- 166
- 288
-
The idea of desktop pane is worked. But the code which helped me is below https://www.youtube.com/watch?v=AH4v_rQRyAk – Arun B R Aug 12 '18 at 15:38