|
-
Oct 20th, 2004, 02:34 PM
#1
Thread Starter
Stuck in the 80s
Stop Objects from Resizing in Swing?
I'm working on the following swing GUI for a project:
What I want to do is make it so the "Simulation Options" don't resize at all, but just stay the same size and don't move when the whole frame is resized. How can I accomplish this?
The "Simulation Options" is a JPanel with a GridLayout.
-
Oct 20th, 2004, 06:08 PM
#2
Dazed Member
Sounds like you want the layout manager to honor the components preferred size. Normally when you don't want a component to stretch out when its container is resized you can add it to a panel then add the panel to a the container. JPanels use the flowlayout manager which does not ignore the componets preferred size as GridLayout does.
-
Oct 21st, 2004, 01:17 PM
#3
Thread Starter
Stuck in the 80s
Not sure I follow.
-
Oct 21st, 2004, 04:04 PM
#4
Dazed Member
Sorry i was assuming that you had a component inside the JPanel that you didnt want resized with the JFrame was resized. Why not keep the frame from being resized in the first place?
-
Oct 26th, 2004, 11:28 AM
#5
Banned
well u could use absolute positioning of the components.. if u don't want the components to be resized... if it does no include moving of components also.
-
Oct 26th, 2004, 11:32 AM
#6
Banned
Re: Stop Objects from Resizing in Swing?
Originally posted by The Hobo
I'm working on the following swing GUI for a project:
What I want to do is make it so the "Simulation Options" don't resize at all, but just stay the same size and don't move when the whole frame is resized. How can I accomplish this?
The "Simulation Options" is a JPanel with a GridLayout.
oops I didn't read that one... gridLayout hmmm.
why don't u use SpringLayout then? on the part of the buttons that is.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|