First off, you start with determining, which LayoutManager
you should use, to arrange your three fields. GridBagLayout
will definitely do what you want, but is quite hard to program. You could try to get away with the simpler BorderLayout
, which will make your application look odd, while resizing. You can use GroupLayout
too. BoxLayout
, GridLayout
and FlowLayout
are not what you want to use. Now you have a lot of options, to lay out you top elements.
Use a JTextField
for the result. Use JCheckBox
for the checkboxes, which you put insider a JPanel
with an etched border (via JPanel.setBorder(BorderFactory.createEtchedBorder())
) and a FlowLayout
. Don't forget to put the checkboxes in a CheckboxGroup
. Last but not least use a JPanel
to group the JButton
s for the, uhh, buttons. Use a GridLayout
(5 rows, 4 columns) to arrange these buttons.