JTable - 布尔单元格类型 - 背景 [英] JTable - Boolean Cell Type - Background
本文介绍了JTable - 布尔单元格类型 - 背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将 Nimbus L&F 与 JTable
一起使用,该JTable
将布尔(复选框)元素作为其列之一.
I'm using the Nimbus L&F with a JTable
that has a boolean (checkbox) element as one of its columns.
我遇到的问题是布尔列不遵循 Nimbus L&F 中存在的自然行背景交替.
The issue I'm having is that the boolean column does not follow the natural row background alternations present in the Nimbus L&F.
推荐答案
这是合成器安装的渲染器中的一个错误,快速破解是强制渲染复选框不透明度为真:
It's a bug in the synth-installed renderer, quick hack is to force the rendering checkbox opacity to true:
((JComponent) table.getDefaultRenderer(Boolean.class)).setOpaque(true);
这篇关于JTable - 布尔单元格类型 - 背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文