Java Swing - JCheckbox with 3 states (full selected, partially selected and deselected)

Yatendra picture Yatendra · Apr 23, 2010 · Viewed 11.2k times · Source

I want a JCheckbox that has 3 states as shown below:

  1. Partially Selected
  2. Unselected
  3. Full Selected

Q1. Can I use the JCheckbox for the above purpose or have to go for some custom swing component?

Answer

Peter Lang picture Peter Lang · Apr 23, 2010

Here is an example for a TristateCheckBox:

http://www.javaspecialists.co.za/archive/Issue145.html

Example showing TristateCheckBox