The GridBagConstraints fill field determines whether and how a component is resized if the component's display area is larger than the component itself. The mnemonic constants you use to set this variable are

Don't resize the component
Make the component wide enough to fill the display area, but don't change its height.
Make the component tall enough to fill its display area, but don't change its width.
Resize the component enough to completely fill its display area both vertically and horizontally.

For the display area of the calculator screen use

displayConstraints.fill = GridBagConstraints.HORIZONTAL;

because you'd like the screen to show as many digits as it can.

Previous | Next | Top | Cafe au Lait

Copyright 1997, 1998 Elliotte Rusty Harold
Last Modified November 1, 2002