I have a check button and I was wondering how to get the value from it. When I use this code it gives me that it is selected always, even when it is not.
public void itemStateChanged(ItemEvent e) {
// TODO Auto-generated method stub
JCheckBox sourceBox = ((JCheckBox)e.getSource());
wave1Invert = wave1Inv.get ();
wave2Invert = wave2Inv.isSelected ();
if (wave1Inv == sourceBox){
if (wave1Invert = true){
System.out.println ("Wave 1 Inv");
}
else if (wave1Invert = false){
System.out.println ("Wave 1 NOT Inv");
}
}
if (wave2Inv == sourceBox){
if (wave2Invert = true){
System.out.println ("Wave 2 Inv");
}
else if (wave2Invert = false){
System.out.println ("Wave 2 NOT Inv");
}
}
}
Thanks for your help