Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

which layout manager

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I 've 4 comboboxes and 4 labels for these comboboxes , one textfield, two buttons. I am planning to add all these to a Jpanel, and I'll add Jpanel to a JFrame. I'll set the layout manager of frame to a border layout.
What layout will be appropriate for the panel. I don't think flow layout will do, since it will get disturbed with resizing, even the same problem with absolute positioning. All suggestions will be appreciated.
Thanks in advance,
Srilatha.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
U can use use Gridlayout for this. Divide ur frame into 5 rows and 1 col . . Put 5 J Panels in each row
Now add 1 label and 1 combobox in each JPanel and 1 textfield and 2 buttons in the last (5th) row.
new GridLayout(5,1);
JPanel p1 = new JPanel();
...
JPanel p5 = new JPanel();

p1.add(new Label("sds"));
p1.add(new JCombo());
....
p5.add(new TextField());
p5.add(new Button());
p5.add(new Button());
c.add(p1);
..
c.add(p5);
That's it,
Arun

------------------
SeE Consulting(P) Ltd
Bangalore,India
Sun Certified Java Programmer
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic