File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Fixed drawing area Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Fixed drawing area" Watch "Fixed drawing area" New topic
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: 89
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Fixed drawing area