void (ActionEvent actionEvent) { Object task = myTasks.getSelectedItem(); if (task != null && (task.toString().equals("rst2latex") || task.toString().equals("rst2odt"))) myOpenInBrowser.setEnabled(false); else myOpenInBrowser.setEnabled(true); }