protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
- protected JCheckBoxMenuItem showAutoFirst = new JCheckBoxMenuItem();
+ protected JRadioButtonMenuItem showAutoFirst = new JRadioButtonMenuItem();
- protected JCheckBoxMenuItem showAutoLast = new JCheckBoxMenuItem();
+ protected JRadioButtonMenuItem showAutoLast = new JRadioButtonMenuItem();
private JMenuItem grpsFromSelection = new JMenuItem();
}
});
+ ButtonGroup buttonGroup = new ButtonGroup();
+ buttonGroup.add(showAutoFirst);
+ buttonGroup.add(showAutoLast);
showAutoFirst.setText(MessageManager.getString("label.show_first"));
- showAutoFirst.setState(Cache.getDefault(
+ showAutoFirst.setSelected(Cache.getDefault(
Preferences.SHOW_AUTOCALC_ABOVE,
false));
showAutoFirst.addActionListener(new ActionListener()
@Override
public void actionPerformed(ActionEvent e)
{
- boolean sortFirst = showAutoFirst.getState();
- setShowAutoCalculatedAbove(sortFirst);
- showAutoLast.setState(!sortFirst);
+ setShowAutoCalculatedAbove(showAutoFirst.isSelected());
sortAnnotations_actionPerformed();
}
});
showAutoLast.setText(MessageManager.getString("label.show_last"));
- showAutoLast.setState(!showAutoFirst.getState());
+ showAutoLast.setSelected(!showAutoFirst.isSelected());
showAutoLast.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
- boolean sortLast = showAutoLast.getState();
- setShowAutoCalculatedAbove(!sortLast);
- showAutoFirst.setState(!sortLast);
+ setShowAutoCalculatedAbove(!showAutoLast.isSelected());
sortAnnotations_actionPerformed();
}
});