[Advanced-java] Readonly property for JCheckBox and JRadioButton
Steve Roy
sroy at mac.com
Mon Apr 14 19:50:11 2003
mwestland@vda.nl (Westland, M.A.P. (Michiel)) wrote:
> This means the background of the field becomes
> gray, while the text remains black and the user
> can still select text, but cannot modify.
Note that this description is for your system of choice, but that this is highly
platform-specific. Each platform has its own behavior for a read-only component.
> JCheckBox and JRadioButton do not have such a
> property, but I need it.
My first idea is that you could override processMouseEvent() to intercept
specific events such as mouse pressed and simply not let them pass through to
the super implementation. Swing might have other or better ways to do that
though.
Steve
--
Steve Roy <sroy@mac.com>
Personal homepage: <http://homepage.mac.com/sroy>
Projects homepage: <http://www.roydesign.net>