简体   繁体   中英

Java JButton mouse over color

I have a Java Swing application that's using "system" look and feel (as i'm using Windows, i'm getting "native Windows" controls in my app). Now, for "branding" reasons i'm trying to enforce particular color on my buttons but i have a problem. I prefer using UIManager but i can't find any property that would let me choose "button mouse over" color. Take a look at the picture attached please:

在此处输入图片说明

Seems like i'm stuck with default Windows "light-blue" color for button mouse over (pointer is not visible in this screenshot).

How can i change that color?

For me only option is some sort of UIManager global variable, i simply can't afford to go through all buttons in my app and override some custom button or add listeners for "mouse enter" and "mouse exit".

The best way to do it is to customize the LAF of your application, using this library TinyLAF . Very easy to use, with nice control panel to help do some theming and using the created theme file on your project.

Here is a small tutorial on how to use it in case the doc is not too clear http://yourjavacode.blogspot.com.ng/2013/05/tinylaf-change-your-java-look-and-feel.html

I hope this helped out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM