It works only if the state is set by code.
As workaround I had to listen for the state by addActionListener and set the current state back into the TristateCheckBox by code.
- Code: Select all
tristate = new TristateCheckBox("Tristate");
tristate.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
tristate.setState(tristate.getState());
}
});
tristate.setState(TristateCheckBox.STATE_UNSELECTED);
I suppose this behaviour is a bug.
Tested in 3.1.1 and 3.2.2 with Java 1.6_27 on Windows7 64bit