• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

A question about GUIs

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic