TableCellEditor无法正确显示 [英] TableCellEditor doesn't show properly
问题描述
我无法编辑单元格,我将拍照,原因是我的英语水平不是很好.
Im having trouble editing a cell, i'll picture cause my english is not very good.
我添加了一个TableCellEditor
(扩展了DefaultCellEditor,我知道不是最好的,但是代码不是我的).当我输入的字母不是
I add a TableCellEditor
(extends a DefaultCellEditor, i know is not the best but the code is not mine). When i type letters are not ,
我试图
table.setRowsHeight(comp.getHeight());
可行,但是我不想要这个,我想要在行中修复文本字段
i tried to
table.setRowsHeight(comp.getHeight());
works but i don't want this, i want the textfield fix in the row
所以我试图
comp.setPreferredSize(comp.getWidth(),table.getRowsHeight())
但不能按预期工作.
So i tried to
comp.setPreferredSize(comp.getWidth(),table.getRowsHeight())
but doesn't work as expected.
推荐答案
在使用Nimbus外观时,我遇到了类似的问题.通过调用
I encountered a similar issue when using the Nimbus look-and-feel. Removing the border by calling
JTextField#setBorder( null )
解决了
这篇关于TableCellEditor无法正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!