问题
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!
回答1:
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);
来源:https://stackoverflow.com/questions/8120213/increase-size-of-text-in-jtree