anchor
anchor
field
specifies where to place it in the grid cell. The mnemonic constants you use for this purpose are similar to those used in a BorderLayout
but a little more specific. They are
The default is
GridBagConstraints.CENTER
. This is not explicitly set in the calculator applet, because the components
are large enough, relative to their display areas, that it really doesn't matter where they go and the default of center is fine.