| Author |
Fixed drawing area
|
Mihai Popa
Greenhorn
Joined: Dec 04, 2011
Posts: 5
|
|
|
I have a JFrame that contains a JPanel used as a drawing area. I want to set a fixed size for this drawing area but the JPanel dimension is set based on the layout manager of the JFrame. What should I do?
|
 |
Tarun Bolla
Ranch Hand
Joined: Jun 20, 2011
Posts: 85
|
|
Depends on the layout you use...
E.g., BorderLayout or GridLayout etc., automatically resizes your internal components whereas FlowLayout etc., doesn't
So you might use a FlowLayout Panel inside a BorderLayout Panel so that just the FlowLayout panel gets resized but the panels inside the FlowLayout will remain intact (Basically a Panel in a Panel sort of thing)
|
 |
Mihai Popa
Greenhorn
Joined: Dec 04, 2011
Posts: 5
|
|
Tarun Bolla wrote:Depends on the layout you use...
E.g., BorderLayout or GridLayout etc., automatically resizes your internal components whereas FlowLayout etc., doesn't
So you might use a FlowLayout Panel inside a BorderLayout Panel so that just the FlowLayout panel gets resized but the panels inside the FlowLayout will remain intact (Basically a Panel in a Panel sort of thing)
Thank you verry much!
|
 |
 |
|
|
subject: Fixed drawing area
|
|
|