如何在JFrame上自定义标题栏? [英] How can I customize the title bar on JFrame?
问题描述
我想在我的Java Swing桌面应用程序中有一个自定义标题栏。最好的方法是什么?我可以在我的JFrame的构造函数中使用以下代码来使用Swing-title bar:
I would like to have a customized title bar in my Java Swing desktop application. What is the best way to do that? I can use a "Swing-title bar" by using the following code in the constructor for my JFrame:
this.setUndecorated(true);
this.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
但我如何自定义它?是否有任何 UI代理我可以覆盖或者我必须从头开始实现我自己的标题栏吗?
But how do I customize it? Is there any UI delegates that I can override or do I have to implement my own title bar from scratch?
我想要像Lawson Smart这样的东西办公室:
I want something like Lawson Smart Office:
推荐答案
您可以在物质外观中看到一个例子 - 感觉(镜像来源)。搜索SubstanceRootPaneUI和SubstanceTitlePane的代码。实现取决于Substance中的其他类,并且不容易在特定库之外重用 - 也不是意味着。
You can see an example in Substance look-and-feel (mirrored source). Search the code for SubstanceRootPaneUI and SubstanceTitlePane. The implementation depends on other classes in Substance, and will not be easy to reuse outside the specific library - nor is it meant to.
这篇关于如何在JFrame上自定义标题栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!