Simon Rubin
Simon Rubin

Reputation: 318

Resizing Components with JFrame

I have a JFrame that contains two JPanel containers. In the below picture one panel is blue, the other contains a JTable. As can be seen, when I resize the frame, the frame (the blank gray area) expands. I would like the table panel to expand to fill this area.

IMG http://i61.tinypic.com/2evujdj.png[/IMG]

What layout managers will accomplish this?

Upvotes: 0

Views: 126

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168815

A BorderLayout with the table in (a scroll pane) in the CENTER and button panel in the PAGE_START should do it. Thought I'd probably use a JToolBar (instead of a JPanel) for the buttons.

Upvotes: 3

Related Questions