• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Help with coding a layout

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!