Posted by zhoupn
on April 3, 2009 at 1:21 AM PDT
Imagine a JPanel that contains a JCheckBox and some other components. The JCheckBox may check its state in response to some non GUI events elsewhere in the application (e.g., a message from a socket).
Is there a way to lock the JPanel so that the user cannot modify the JCheckBox (no, it cannot be disabled since that is the purpose of using JXLayer) while still having the GUI of the JCheckBox responding to non GUI events?
I understand that I can call setDirty(true) if we do get such an event. However, this is somewhat intrusive. I would prefer a kind of LockUI which will block the mouse and keyboard events to the JPanel while at the same allows the GUI to be visible. The current LockUI simply presents a snapshot. In a word, I would prefer a transparent glass pane that receives all the GUI events.
Is this possible?