It's not a secret anymore!*
The moose likes Swing / AWT / SWT and the fly likes Custom CheckBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Custom CheckBox" Watch "Custom CheckBox" New topic

Custom CheckBox

seema chhetri
Ranch Hand

Joined: Feb 17, 2009
Posts: 41

Please can you tell me how i can use a custom CheckBox . and what is the code.

i want to put custom checkbox in My Jtree.

Thanks & Regards,
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10172

Like the JList and JTable, JTrees also use Renderers. You will need to provide a custom renderer which renders the required nodes as JCheckboxes instead of JLabels, which are the default.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
did you get your checkbox in a JTable here?
Rob Spoor

Joined: Oct 27, 2005
Posts: 19656

You'll probably also have to handle the mouse clicks on the check boxes manually.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Custom CheckBox
Similar Threads
logic problem or thread problem?
how to put images on displaytags column header????
Jide CheckboxTreeCellRenderer
Nested JSP Expressions not working
Nest the selectOneRadio Under the selectManyCheckbox