Link to home
Start Free TrialLog in
Avatar of bored_shiva
bored_shiva

asked on

Changing a Java Frame's close/min/max icons

I have an application that uses a JFrame as the main window for the app. I am using swing plaf to change certain things about how the frame looks and how the components look, for example:
   String dLook = UIManager.getSystemLookAndFeelClassName();
   UIManager.put("ScrollBar.highlight",new ColorUIResource(255,0,0));
   UIManager.put("TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 14));
   UIManager.setLookAndFeel(dLook);                        

What I'd like to do is to change the default icons for close/minimize/maximize on my Frame/windowsTitle (I'm not sure which one am I actually referring to, but they are the ones at the top right of every window.)       I saw a bunch of JInternalFrame properties to edit, but none for the overall frame (External frame?)  I want to set the icons for things like close, close_pressed, and close_mouse_over to my own png images.
Thanks
Avatar of basav_com
basav_com
Flag of India image

Avatar of bored_shiva
bored_shiva

ASKER

basav_com,
That solution lets you modify the frame icon (on the upper left) I want to modify the CLOSE, MIN, and MAX, icons, on the upper right.
I know this is possible, because I see skin engines like skinlf do it. The question is how to do it using the built-in Java tools.

Thanks
oops... I overlooked at your question :)
ASKER CERTIFIED SOLUTION
Avatar of Thomas4019
Thomas4019
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thomas,
How do I go about creating my own WindowsBorder? I saw that JRootPane can specify different WindowsDecorationStyles that are built into it, but I was not able to find how to create my own style.
Thanks
To create you own border, the way i recommend is overriding the paint method. Then you have a graphics object and have complete control over what to draw and where. If you have never overrided the paint method before i can post an example.