Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom CheckBox

 
seema chhetri
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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,
Seema
 
Maneesh Godbole
Saloon Keeper
Posts: 10973
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you get your checkbox in a JTable here?

http://www.coderanch.com/t/431744/Swing-AWT-SWT-JFace/java/checkbox
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll probably also have to handle the mouse clicks on the check boxes manually.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic