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
GridBagConstraints.NONE
: Don't resize the component
GridBagConstraints.HORIZONTAL
: Make the component wide enough to fill the display area, but don't change its height.
GridBagConstraints.VERTICAL
: Make the component
tall enough to fill its display area, but don't change its width.
GridBagConstraints.BOTH
: Resize the component enough to
completely fill its display area both vertically and horizontally.
displayConstraints.fill = GridBagConstraints.HORIZONTAL;
because you'd like the screen to show as many digits as it can.