0

I need an off/on indicator for a panel in my Swing application.

My gut reaction is to try to use a JCheckbox, and somehow disable the mouse input and change the checkbox state only through my program. But a radio button would look better.

Is this the best way to do so (& if so, how to disable mouse input w/o making the control look disabled), or is there a better indicator element?

Jason S
  • 184,598
  • 164
  • 608
  • 970

2 Answers2

1

Yep, why not. Just use setEnabled() method (JPanel inherits it, so don't worry).

Xorty
  • 18,367
  • 27
  • 104
  • 155
0

Use check box but change the icon to look like following round button ( which is a check box BTW ) alt text

Community
  • 1
  • 1
Eugene Ryzhikov
  • 17,131
  • 3
  • 38
  • 60