Is it possible to customize the main rendering of a JFrame header in Swing?

I would like to customize the title of my main JFrame in a Swing application.

There are two things I would like to do but cannot find a way to achieve it:

Is there a way to do this easily in Swing?

Thank,

+3


source to share


2 answers


You cannot modify the system's own frameworks / dialogs (including the title / dialog).

There are two ways to change the whole frame / dialog box though:



  • You need to use some specific L&F in your application that have custom frameworks / dialogs and allow you to change it - I really don't know if there are any. (you can find many L & Fs that have their own frame / dialogue decorations, like this one )

  • You need to install your own RootPaneUI, which will customize the frame decoration, but keep in mind that you will have to write all the decoration functions for the frames / dialogs yourself (including dragging and resizing the window, control buttons, title and others), which requires a good knowledge of custom interfaces, graphics and Swing.

+2


source


Another way (I used Delphy a few years ago ...):



Don't display the title bar by default and don't put your own on one (done with whatever you want: p) and override all behavior (drag n, increase, collapse, ...).

+1


source







All Articles