O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Component Preferred, Minimum, and Maximum Sizes

Components can specify their preferred, minimum, and maximum sizes by overriding getPreferredSize(), getMinimumSize() and getMaximumSize(), respectively.

It is important to emphasize, however, that overriding the methods listed above does not guarantee anything about a component's size. The methods are merely guidelines that may well be ignored by the objects that size components—layout managers. Layout managers and component preferred sizes are discussed in “Components, Containers, and Layout Managers”.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required