日期:2014-05-20  浏览次数:20576 次

|||||||求教JTable问题
需要在JTABLE中的某一列的单元格显示为自己写好的JPanel.请问怎么做?

我的列名和数据直接用的是String[]   columnNames和Object[][]   data。

我搜索过这类的问题,应该是需要用setCellRenderer吧?
可是不知道具体怎么用,求高人指点。谢谢!



------解决方案--------------------
直接加入就行了,容器套容器
------解决方案--------------------
用setDefaultEditor~~~~~~~~
参考http://java.sun.com/docs/books/tutorial/uiswing/components/examples/index.html#TableDialogEditDemo