Increase size of Text in Jtree

喜你入骨 提交于 2019-12-24 04:13:05

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!