Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 Jtable 并打算向其中添加 JCheckboxes。这里有一个非常清晰的示例 ,我实现了它,但在运行时不断获取“true”和“false”字符串值。然后我尝试运行示例本身,发现它也显示“true”/“false”字符串值。
这是我的 JRE 的问题吗?我怎样才能查看/使用复选框?
谢谢。
你确定在你的表模型中覆盖了这个函数吗?这就是告诉表格这些值是Booleans.
Booleans
@Override public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); }