• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with coding a layout

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to code the following layout but am inexperienced with FlowLayout, GridLayout and BorderLayout. Can someone give me an example of code for the following layout?

 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tell the truth now, is this a homework assignment?

Well, off hand it looks like you could set the top level layout as BorderLayout. Add one panel to it's NORTH, CENTER, and SOUTH.
The 'NORTH' Panel could just use FlowLayout, and you would create the TextArea on the right with the constructor that defines the number of columns and rows.

The 'CENTER' Panel would just be a JScrollPane with a TextArea in it.

The 'SOUTH' Panel could be GridLayout with one row and five columns, might have to do some playing with the size of the buttons.

If this is not homework I think the GUI you have there is pretty ugly and you would be better off going with JGoodies forms.

That should be more than enough to get you started.
 
Adam Blais
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help that's exactly what I needed.

This is a homework assignment. I finished the entire program and just wanted to get the GUI layout the way I wanted. Thanks again.
 
reply
    Bookmark Topic Watch Topic
  • New Topic