为什么 JTree 叶子图标被替换为“项目符号”?

发布于 2024-09-05 02:46:25 字数 236 浏览 12 评论 0原文

我在应用程序中进行了一些包和 jar 重构,现在我遇到了一些外观和感觉问题。 - 更容易解释的是,在 JTree(嵌入 JXTreeTable 中)中,我不再有“叶子”(文件)图标,而是灰色子弹...... - 另一个问题是 TextArea 中的默认字体变成了“Courier”,我不得不在 UIManager 中将其强制为正常字体才能恢复正常...

有没有人已经见过这个问题并知道为什么会发生以及如何修复它?

非常感谢。

I did some package and jar refactoring in my application and now I have several look&feel issues.
- The one which is easier to explain is that in JTree (embedded within a JXTreeTable), I no longer have "leaf" (file) icon but gray bullet instead...
- Another one is that the default font in TextArea became 'Courier', I hade to force it to a normal font in UIManager to go back to normal...

Has anyone seen this issue already and knows why it happens and how to fix it ?

Thanks very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滥情稳全场 2024-09-12 02:46:25

其中一个 jar 很可能正在改变(或不再改变)应用程序的外观和感觉。听起来您好像从 Java 外观转向了“Windows 默认”外观。您可以尝试自己设置外观和感觉,看看是否可以获得所需的结果。

如果只是叶子图标有问题并且您想解决它,则可以将图标更改为任何图像: http://download.oracle.com/javase/tutorial/uiswing/components/tree.html#display

More than likely one of the jars is changing (or is no longer changing) the look and feel of the application. Sounds like you went from the Java look and feel to the "Windows Default" Look and feel. You can try setting the look and feel yourself and see if you can get the desired results.

If it is just the leaf icon that is the problem and you want to work around it, you can change the icon to any image: http://download.oracle.com/javase/tutorial/uiswing/components/tree.html#display.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文