JRadioButton, JCheckBox disabled look

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top