java - Setting orientation within a JPanel -


I am trying to use nested zapenal, which I can reuse in different parts of my application, Such as on the navigation bar page. I'm having trouble setting an item's orientation, like I want the button to be above the textfield.

If I make them individually and add them directly to the zennial then they intared like each other, as in the following:

  the last JFrame frame = New JFrame ("Nested Layout Example"); Frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Final Genpel Gwi = New Zippin (new border layout (5, 5)); Gui.setBorder (new title board ("boundary (5,5)"); Pocket button = new pocket ("button"); Pocket button 1 = new pocket ("button 1"); Gui.add (Button, Border Layout. North); Gui.add (Button 1, Border Layout. South); Frame.setContentPane (GUI); Frame.pack (); Frame.setLocationRelativeTo (zero); {// 1.6+ frame. Try the SettlementPlatform (Truth); Frame.setMinimumSize (frame.getSize ()); } Hold (Thrownable EndContinuinu) {} Frame.Serviceable (true); However, if I have created a nested jepennial and have placed it in another zennial, then I can reuse it, they come out from the bottom:  
  last JFrame frame = new JFrame ("Nested Layout Example"); Frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Final Genpel Gwi = New Zippin (new border layout (5, 5)); Gui.setBorder (new title board ("boundary (5,5)"); Japanese container = new zpn (); Pocket button = new pocket ("button"); Pocket button 1 = new pocket ("button 1"); Container.ed (button, border layout. North); Container.ed (button1, border layout. SOTH); Gui.add (container); Frame.setContentPane (GUI); Frame.pack (); Frame.setLocationRelativeTo (zero); {// 1.6+ frame. Try the SettlementPlatform (Truth); Frame.setMinimumSize (frame.getSize ()); } Hold (Thrownable EndContinuinu) {} Frame.Serviceable (true); I have tried to set componenetOrientation,  
  container.set content orientation (component orientation).  

but there is no option for vertical

I tried to set componenetOrientation

Please note that the component of the problem is nothing to do with orientation: it is a layout manager problem as described below. has gone.

However, if I create a nested jepennial and put it in another zennial, then I can reuse it,

< / Blockquote>

here:

  JPNEL container = new JPNEL (); ... container.ed (button, border layout. North); Container.ed (button1, border layout. SOTH);  

is the default layout manager for the panel and it will ignore the border layout constraints and not just the Layout Manager for the GUI panel , But also with the container panel.

  JPanel container = new JPNail (new border layout ()); ... container.ed (button, border layout. North); Container.ed (button1, border layout. SOTH);  

Comments