Assumption : You need a by-default decorated JFrame, which acquires the look & feel of the machine's operating system.
Setting an icon and customizing text on Title bar is easy.It can be done as shown below,
class TitleBar {
TitleBar(){
Frame f=new Frame();
//Setting TitleBar icon with "YourImage.png"
f.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("YourImage.png")));
//set other parameters as per your choice viz size layout etc.
//Set the Title Bar text
f.setTitle("YOUR CUSTOM TEXT");
f.setVisible(true);
}
Now with the frame decoration turned "ON", it is not possible to change the color of titlebar, font of the top-level JFrame (to the best of my knowledge). You CAN change the color of an InternalFrame however.
If you want to customise these then turn off windows decorations with f.setUndecorated(true) and you can change the title bar appearance with the help of LAF (Look And Feel). This is better explained in the answer below :
Change the color of the title bar in javax.swing
You may also try modifying the UIDefaults as shown here :
Modifying UIDefaults | For Windows 10 and above
Do upvote if my answer is useful !!