1

I am trying to design this scholarship application, but I'm stick figuring out which layout manager to use. Till date, I've only used BorderLayout, and so I'm a bit new to the game.

Attached is the screen shot, what should my approach be? All the entries inside a JPanel of a specific layout manager?

Also, how would I have the 'scholarship name', deadline inside that green rectangle background

my screen shot

Community
  • 1
  • 1
zoy.khan
  • 87
  • 1
  • 9
  • Also look at [this excellent example](http://stackoverflow.com/a/5630271/1076463) of @AndrewThompson . Nesting layouts is the way to go for you – Robin Nov 18 '12 at 10:02

1 Answers1

4

You shouldn't just use one layout manager but instead should nest containers, each using its own layout. For instance, the JPanel held by the JTabbedPane could use BorderLayout, and in its NORTH position, hold a JPanel that uses BoxLayout. In the main BorderLayout-using JPanel's center position you could have a JScrollPane that holds a JTable that uses a custom cell renderer...

Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
  • I was thinking of using a JPanel for each scholarship application, how would I use a table for it? – zoy.khan Nov 18 '12 at 04:00
  • 1
    @afturk: You could use a JPanel held by another JPanel in a `GridLayout(0, 1)`, the holding JPanel being held by a JScrollPane. The key is to read the layout manager tutorial and to experiment. – Hovercraft Full Of Eels Nov 18 '12 at 04:03
  • Would you recommend doing it manually, or using the netbeans GUI editor? – zoy.khan Nov 18 '12 at 04:05
  • I've tried reading the Layout manager tutorial, but it confuses me at times, give my exact requirements. – zoy.khan Nov 18 '12 at 04:06
  • 1
    @afturk.khan: definitely do it manually. Consider re-reading the tutorial with an eye to using multiple nested JPanels each with its own simple layout manager. – Hovercraft Full Of Eels Nov 18 '12 at 04:07