• Post Reply Bookmark Topic Watch Topic
  • New Topic

A question about GUIs

 
Giles Humphreys
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When doing GUI work, what is the relation between the attributes PreferredSize, Size, MaximumSize, MinimumSize etc. and the actual size of a component?
It seems that how I set these has variable and marginal effect on the actual size of a component.
Can you help??
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you could use the Java Tutorial: Creating a GUI with Swing chapter on Laying out Components Within a Container
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only if you use any layout manager for the parent container, the MaximumSize, MinimumSize, PreferredSize attributes may effect on the actual size of a component.

The layout manager will dynamic calculate out what Size each component should be in this container, according to the above attributes.

[ August 20, 2004: Message edited by: Pool Hays ]
[ August 20, 2004: Message edited by: Pat Hays ]
 
Warren Dew
blacksmith
Ranch Hand
Posts: 1332
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that some layout managers pay attention to minimum/preferred/maximum sizes, and others ignore them, and some pay attention only in some positions. Unfortunately, as with all things Swing, what actually happens in any individual case is poorly documented, so you have to experiment.
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!