adrien.pain
adrien.pain

Reputation: 453

Is it possible to customize main JFrame title rendering in Swing?

I'd like to customize the title of my main JFrame on a Swing application.

There's two things I'd like to do, but can't find any way to achieve it :

Is there any way to do that easily in Swing ?

Thanks,

Upvotes: 3

Views: 629

Answers (2)

Alexxx
Alexxx

Reputation: 786

Another way (I used in Delphy some years ago...):

Don't display the default title bar, and put your own on one (made with all you want :p), and reimplement all the behaviaviour (drag n drop, maximize, minimize,...).

Upvotes: 1

Mikle Garin
Mikle Garin

Reputation: 10143

You cannot modify system native frames/dialogs decorations (including frame/dialog title).

Though there are two ways to modify the whole frame/dialog decoration:

  1. You have to use some specific L&F in your application that has custom frame/dialog decorations and allows to change it - i don't really know if there is such. (you can find many L&Fs that have their own frame/dialog decorations, for example this one)

  2. You have to install your own RootPaneUI that will customize frame decoradion, but be aware that you will have to write all of the frame/dialog decoration features on your own (including window drag and resize, control buttons, title and others) - that requires a good knowledge of UIs, graphics and Swing.

Upvotes: 3

Related Questions