JComponent () { JPanel panel = new JPanel(new VerticalFlowLayout()); ButtonGroup group = new ButtonGroup(); group.add(myCompact); group.add(myCanonical); group.add(myCustom); panel.add(myCompact); panel.add(myCanonical); panel.add(myCustom); return panel; }