This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes TriState CheckBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "TriState CheckBox" Watch "TriState CheckBox" New topic
Author

TriState CheckBox

Nadeem Awad
Ranch Hand

Joined: Jan 09, 2005
Posts: 74
Hi all,
I'm trying to create a tristate checkbox. I want to change the displayed image on the third state, so the three states would be something like this:
Blank (First State)
Yes (Second State)
No (Third State)

I've seen many posts that use the setArmed, setPressed and setSelected methods of the ButtonModel, but that's not what I want. I need to change the painted image on the checkbox, but I can't seem to know where that's done.

Any Ideas?
[ March 15, 2006: Message edited by: Nadeem Awad ]

Share Knowledge to gain it.<br /> <br />SCJP 1.2, SCDJWS 1.4, SCWCD 1.4, SCBCD 1.3, ICAD
Nadeem Awad
Ranch Hand

Joined: Jan 09, 2005
Posts: 74
Any ideas? Anyone?
Nadeem Awad
Ranch Hand

Joined: Jan 09, 2005
Posts: 74
I finally got it
I found some code on the java forums and I modified it to do what wanted.

Biliang Zhou
Ranch Hand

Joined: Jun 28, 2006
Posts: 43
Congratulations!

It can be quite useful actually...

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TriState CheckBox