Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

getPreferredSize

What determines/changes the "preferred size?"
0
menubar
Asked:
menubar
1 Solution
 
smileyxxCommented:
If you subclass Component, you can do it yourself by overriding the getPreferredSize() method.
0
 
superschlonzCommented:
Components should calculate their preferred size from the text and other stuff they display.
Containers have a Layout which calculates the preferred size from the values the components in
this container return.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now