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

JTree node problem  RSS feed

 
Jerry Crothers
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTree with checkboxes and a CheckRenderer that extends JPanel and implements TreeCellRenderer.

I want to increas the CheckRender panel size slightly but can not. I have tried creating an empty border and setting the bounds in the constructor. Also I modified the getPrefferedSize() method in the CheckRenderer. However the node size remains too small, any ideas?

Also I would like to change the foreground text color to white when the node is selected. How do you do that?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi "jc98789",

welcome back to the Ranch!

Please adjust your display name to conform to our naming policy. Thanks!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!