I noticed when adding multiple panels in JFrame content pane, if you set all the panels to be visible, you going to see (with set different background color ) some of them overlapping each other. I wanted to know if it is possible to have one master panel, that even though you add extra panels, that one panel from before will remain on top of all them?
Asked
Active
Viewed 97 times
0
-
Normally one uses a [LayoutManager](https://docs.oracle.com/javase/tutorial/uiswing/layout/using.html) to prevent panels from overlapping. What are you actually trying to do? – markspace Aug 28 '16 at 14:49
-
@markspace I am trying to add a panel within the JFrame contentPane that no matter what order it was added into the contentPane, when it is visible it will always be on top of any other panels within the contentPane. I am trying to simulate some type of Navigation Drawer like the one in Android Studio IDE packages. – Chuck Aug 28 '16 at 15:10
-
OK, and do you want the panel to open from the left side, or some other direction? Edit: also, are you literally using Swing on the desktop, or is your target system something else? – markspace Aug 28 '16 at 16:22