简体   繁体   中英

How to make Swing Checkbox in list with different background color

Lets start with saying Im not very knowledgeable with Swing. But I have a regular JTable where I have various columns, some of which is Booleans which gets translated to checkboxes. And as you can see in the image below, their background is pure white, and doesnt follow the "alternative" coloring as the other fields (Double and Strings). Any clue on what is happening here is appreciated.

具有仅白色背景的复选框的Swing应用程序示例

Thanks for the comments guys. It led me straight right! So I googled some custom renderer for Nimbus and checkboxes and found this which did exactly that I wanted.

https://code.google.com/p/jsparklines/source/browse/trunk/src/main/java/no/uib/jsparklines/extra/NimbusCheckBoxRenderer.java?r=77

Thanks again

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