简体   繁体   English

JTable ..所选行的颜色

[英]JTable .. colour of selected row

I have a JTable in Java that has a custom dataMOdel and custom renderer. 我在Java中有一个JTable,其中有一个自定义dataMOdel和自定义渲染器。 Now when i select some cell it has a dark blue border around it. 现在,当我选择某个单元格时,它周围有一个深蓝色边框。 I want the selected row to be all highlighted in some colour. 我希望所选行全部以某种颜色突出显示。 How to do that? 怎么做?

You have to use custom table cell renderer. 您必须使用自定义表格单元格渲染器。 Check out the tutorial here: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#renderer 在此处查看该教程: http : //java.sun.com/docs/books/tutorial/uiswing/components/table.html#renderer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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