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

JTree font size question  RSS feed

Joe Crew
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using jdk118 and swing 111. I've created a JTree I've also created new [+] and [-] signs that expand and collapse a branch node. I made new ones so they can be larger than standard. I've also created a graphic that replaces the windows system folder icon for nodes that contain children. Again no problem to create it and I created it so it would be larger. Now I want to change the font size to a larger font. I used the typical:
Font tf = new Font("sansserif",Font.PLAIN,16);
Again this works, as does everything else does. As you can see from my description above, I am trying to make everything in the JTree larger, the folder icons, the expand/collapse icons, and the font. All of the code works but there is one thing that does not work. The spacing between the text, icons, and/or text strings. For example, say there is 1/4 inch of an inch of space to put you text on a line in the jtree. If I create a font of 24, which I would like to use, the text from one node starts overlapping the lines below and above it. The 1/4 inch space does not increase. The text and icons all over lap. If I create a [+] icon that is over 17 pixels, the icons start overlapping each other. I thought by creating new icons and larger text, the space between each line in the jtree would expand and accomodate them but it hasn't. Has anyone experienced this? Do you have any work arounds? Anything you can tell me on this subject would be appreciated.
Joe Crew
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!