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 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)