user interface - java gui - overlapping panels? -


I'm just trying to make this little simulator in a GUI, I have two main components - a map, most Take a window, and a control panel on the right hand side. Now, I would like to add a time slider under the window (not just under the control panel, running under the map) I can do it in the Runner class (which starts the main window), but it logically controls Room should be related - it removes all relevant events. Is there any way to do this? Should swing components be used and how should I wrap them? << / P>

Thank you very much for your help

Receive the desired results very easily You can use the border layout to do; E.g.

  JPNL PNL = new zpn (new border layout ()); Pnl.add (mapPnl, BorderLayout.CENTER); Pnl.add (controlPnl, BorderLayout.EAST); Pnl.add (Timer PNL, Border Layout. SOTH);  

If you are adding more components to your higher level JPanel , then I think that in GridBagLayout Recommends because it offers more flexibility.

The fact that your control and timer related are not relevant to the layout of the visual components. Usually you will maintain this relationship at the business relationship level; E.g.

  Controller Controller = New Controller (); JPNL control panel = new MyControlPanel (controller); JPNL Timer PNL = New MightyPanel (ControllerGet Timer ());  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -