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
GridBagConstraints.NONE
GridBagConstraints.HORIZONTAL
GridBagConstraints.VERTICAL
GridBagConstraints.BOTH
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.