The Artima Developer Community
Sponsored Link

Java Buzz Forum
RatioLayoutManager: Swing and white space

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Delap

Posts: 1154
Nickname: scottdelap
Registered: Sep, 2004

Client / Server application developer.
RatioLayoutManager: Swing and white space Posted: Jun 7, 2005 11:50 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Scott Delap.
Original Post: RatioLayoutManager: Swing and white space
Feed Title: ClientJava.com
Feed URL: http://www.clientjava.com/archives/wireless_mobile.rdf
Feed Description: Client/Desktop Related Java Development
Latest Java Buzz Posts
Latest Java Buzz Posts by Scott Delap
Latest Posts From ClientJava.com

Advertisement

RatioLayoutManager: Swing and white space
I saw this post on clientjava and it got me thinking about an experiment I had done a while back on ratio's and Swing's LayoutManagers. The blog described how to build a window that kept it's ratio of width to height when someone tried to resize it. A while back I thought about using ratios with LayoutManagers to describe what the overall design of your window should look like.

Swing's LayoutManagers are great, but how many times have you put all your components in a frame or dialog, called pack(), looked at the results and replaced the pack() with setSize()? It happens all the time for me. Trying to get Swing's LayoutManagers to look pleasing is a hard task without hard coding the size of something. The LayoutManagers use preferred size to achieve what they think is aesthically pleasing. They sum all the preferred sizes up and figure that's what's pleasing. However, if you set the component's preferred size you're ultimately hard coding the size of the components. Using preferred size starts to undo the whole point of LayoutManagers.

Read: RatioLayoutManager: Swing and white space

Topic: Help Sun Polish Synth Previous Topic   Next Topic Topic: JavaLobby: L2FProd - Choose Directories with JDirectoryChooser

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use