B
bcr666
I have a need to disable various JCheckBox and JRadioButton objects.
When they are disabled however, I want an "Unavailable Cursor" and I
want the object drawn normally (while being unclickable).
I have subclassed the objects in question, and added this method.
public void setEditable(boolean editable) {
this.editable = editable;
if (editable) {
this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
super.enableEvents(Event.MOUSE_DOWN | Event.MOUSE_UP);
} else {
this.setCursor(CursorFactory.createUnavailableCursor());
super.disableEvents(Event.MOUSE_DOWN | Event.MOUSE_UP);
}
}
The super.disableEvents() methods however don't seem to do anything in
my case.
When they are disabled however, I want an "Unavailable Cursor" and I
want the object drawn normally (while being unclickable).
I have subclassed the objects in question, and added this method.
public void setEditable(boolean editable) {
this.editable = editable;
if (editable) {
this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
super.enableEvents(Event.MOUSE_DOWN | Event.MOUSE_UP);
} else {
this.setCursor(CursorFactory.createUnavailableCursor());
super.disableEvents(Event.MOUSE_DOWN | Event.MOUSE_UP);
}
}
The super.disableEvents() methods however don't seem to do anything in
my case.