How can I customize the title bar on JFrame?
Asked Answered
S

1

15

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);

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?

I want something like Lawson Smart Office: Lawson Smart Office

Selfopinionated answered 6/5, 2010 at 14:50 Comment(1)
You know, I wish you wouldn't - I want all my windows to look consistent.Gilbertogilbertson
G
8

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.

Griffy answered 8/5, 2010 at 5:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.