Laying Out Components within a Container |
This page will include answers to common questions such as:Problem: My custom component is being sized too small.
- How do I specify a Component's exact size?
- How do I resize a Component (Component-initiated resizing)?
- How do I increase or decrease the number of Components in a Container?
- Does the component implement the
preferredSize()
andminimumSize()
methods? If so, do they return the right values?- Are you using a layout manager that can use as much space as is available? See General Rules for Using Layout Managers for some tips on choosing a layout manager and specifying that it use the maximum available space for a particular component.
What else should this page cover? Send me suggestions!
Laying Out Components within a Container |