void (boolean moveToPackage) { if (moveToPackage) { rbMoveToPackage.setSelected(true); } else { rbMoveToFile.setSelected(true); } rbMoveToPackage.addActionListener( e -> { classPackageChooser.requestFocus(); updateControls(); } ); rbMoveToFile.addActionListener( e -> { fileChooser.requestFocus(); updateControls(); } ); }