Change the color of the panel title in Java Swing

I am running swing application on win7 with 144 DPI flat panel monitor The titles of my frame, options pane, etc. are displayed in white (aero?) on a transparent background I generally like Aero, but the white title is hard to read! I've browsed through all the UI manager properties I can think of, but they don't seem to have any effect I can find a level under uimanager - and it's best to make a change for my application because I don't want to add code for each option pane call Maybe I missed some very basic things... But I would appreciate it!

I also want to change the title font, but it's not urgent!

In addition, btw, you placed uimanager before or after setting the appearance Put call? Or doesn't it matter?

More information: I changed my win7 personalization and used an aero theme named Canada. The title is now black and uses a reasonable font So my question becomes:

How are uimanager properties related to win7 themes and how do I control the appearance of pane titles because I can't predict which themes users will use?

I'll ask this question in another way: why can't I change the color of each pixel in the application display panel? Is there a level lower than uimanager, which seems to be very limited in the content you are allowed to modify?

Solution

This approach can be a little complicated, but if you need full control of your own container,

1) Create UN_ decorated JFrame / JDialog

2) On the North position, you can simulate containers from win7 with JPanel and gradientpaint

3) And put the three jbuttons with icon into the JPanel with gradientpaint

4) Adding the required events to jbuttons and better output to the GUI will set jbuttons #setcontentareafilled (false)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>