P R
P R

Reputation: 1301

Increase size of Text in Jtree

I'm trying to increase the size of the text of nodes in my Jtree. Is there any way to do this with/without altering other swing components?

Thanks!

Upvotes: 2

Views: 4421

Answers (1)

dogbane
dogbane

Reputation: 274532

Use JTree.setFont. For example:

final Font currentFont = tree.getFont();
final Font bigFont = new Font(currentFont.getName(), currentFont.getStyle(), currentFont.getSize() + 10);
tree.setFont(bigFont);

Upvotes: 3

Related Questions