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:
-
use an image to put the header of the main JFrame. Something like this: http://www.hostingpics.net/viewer.php?id=521357Untitled.png
-
use a GradientPaint (or a similar "customization") to place the gradient color behind the JFrame's header. Something like this: http://www.hostingpics.net/viewer.php?id=842390Untitled2.png
Is there a way to do this easily in Swing?
Thank,
source to share
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.
source to share