JTable ..所选行的颜色 [英] JTable .. colour of selected row

查看:100
本文介绍了JTable ..所选行的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java的JTable,其中有一个自定义的dataMOdel和自定义的渲染器.现在,当我选择某个单元格时,它周围有一个深蓝色边框.我希望所选行全部以某种颜色突出显示.该怎么做?

I have a JTable in Java that has a custom dataMOdel and custom renderer. 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?

推荐答案

您必须使用自定义表格单元格渲染器.在此处查看该教程: http://java.sun. com/docs/books/tutorial/uiswing/components/table.html#renderer

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

这篇关于JTable ..所选行的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆