JPanel () { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(myChooser); JPanel buttons = new JPanel(); JButton all = new JButton(LangBundle.message("label.all")); all.addActionListener(__ -> myChooser.setAllElementsMarked(true)); buttons.add(all); JButton none = new JButton(LangBundle.message("label.none")); none.addActionListener(__ -> myChooser.setAllElementsMarked(false)); buttons.add(none); JButton invert = new JButton(LangBundle.message("label.invert")); invert.addActionListener(__ -> myChooser.invertSelection()); buttons.add(invert); panel.add(buttons); return panel; }