I am running a Swing application on Win7 using a 144 dpi flatscreen monitor. The titles of my frames, option panes, etc., all appear in white on a transparent background (Aero?). I like Aero in general, but the white titles are very hard to read! I have gone through all the UIManager properties I can think of and none of them seem to have any effect. Is there a level below the UIManager that I can get to - and preferably make the change once off for my app, as I don't want to have to add code for every single option pane invocation. Maybe I am missing something very basic... but help would be appreciated!
I'd like to change the title fonts as well, but this is not as urgent!
Also, BTW, do you put UIManager.put calls before or after setting the Look and Feel? Or doesn't it matter?
More info: I changed over my Win7 personalization to use an Aero theme called Canada, and the titles are now in black, using a reasonable font. So my question becomes:
How do UIManager attributes relate to Win7 themes, and, given that I can't predict what theme users will be using, how do I control the pane title appearance?
I am going to put this question another way: why can't I change the colour of every pixel in my application's display panel? Is there a level below the UIManager, which seems to be very limited in what you are allowed to modify...?
put("JFrame. activeTitleBackground", Color. red); for change the toolbar color in JFrame.
We can set a background color to JPanel by using the setBackground() method.
setForeground(Color. X) ; will change the color of the text. For example, . setForeground(Color.
First, you can set the JFrame title when you construct your JFrame, like this: JFrame jframe = new JFrame("My JFrame Title"); Second, once you have a valid JFrame object, you can call the setTitle method of the JFrame class, like this: jframe.
This way will be little bit complicated, but if you needed own Container with full-control,
1) create Un_decorated JFrame/JDialog
2) on the NORTH possition you can put JPanel
with GradientPaint
that simulating container that came from Win7
3) and put 3 JButtons
with Icon to the JPanel
with GradientPaint
4) add required events to the JButtons
and for nicer output to the GUI would be to set JButtons#setContentAreaFilled(false)
Use the setUndecorated(false)
method to turn off the window decorations of the host platform.
Below is an example of this, though it is for the Mac OS platform, it may provide you with a starting point. Re-paint on translucent frame/panel/component.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With