0

I need to know how to select a layout for a java swing application with multiple windows.

It has a dashboard kind home or main window with few icons(12 or more) on it. Clicking on an icon it will open a complex window on top of it then the main window is no longer visible. There will be another home icon to get back to main window on new view. Complex in the sense the opened window will have a tabbed layout. What i need to know is what layout should I use for this purpose. Card layout and layered layout are the candidates I suppose. Or should I use separate frames or is there some other option available. If the window can take the full screen and position the icons on it zooming appropriately according to the screen size would be great. I'm glad if you can provide me a reference to a sample code.

Thank you in advance for helping me out.

LSL
  • 1
  • 1
  • See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/q/9554636/418556) *"I'm glad if you can provide me a reference to a sample code."* SO is not a code generation machine, and questions should not ask for something that is an offsite resource (e.g. 'a link to da codez'). As an aside, what is your actual *question*? So far you've not asked one. – Andrew Thompson Jun 10 '16 at 10:58

1 Answers1

0

I suppose you want to hide home screen when user opens another screen, and show it again when user clicks something like "Home" button.

For similar thing, I used JLayeredPane. It essentially allows you to sat Z-order for your components. In this case, you would have a JPanel for each screen you want to show, and you need to place it inside JLayeredPane, with home screen being initially on top. When you want to show another screen, you set it's layer to be topmost.

vdjurovic
  • 178
  • 2
  • 13