的高度我有一个JTable,其中1列包含每个小区如何改变一个单选按钮
mgrdData.getColumnModel().getColumn(intCol).setCellRenderer(new RadioButtonRenderer());
RadioButtonEditor butEdit = new RadioButtonEditor(new JCheckBox());
mgrdData.getColumnModel().getColumn(intCol).setCellEditor(butEdit);
这工作正常为示出了单选按钮,和正确的参数被选择3个单选按钮。
但是,单选按钮太大而不能完全可见,所以我想降低单选按钮的高度。
我试着改变字体大小,以及.setSize(),但是这对radiobutton的高度没有任何影响。
搜索了很多之后,所有我能找到的是以下几点:
btnVA.putClientProperty("JComponent.sizeVariant","mini");
btnUIT.putClientProperty("JComponent.sizeVariant","mini");
btnAAN.putClientProperty("JComponent.sizeVariant","mini");
其中btnVA,btnUIT和btnAAN是我RadioButtonRenderer的单选按钮。
如果你想看到更多的代码让我知道,我会在编辑它。
有什么特别,我要补充,使单选按钮将此ClientProperty?
感谢您的回答!我通过将LookAndFeel更改为Nimbus来找到解决方案。 – Hrqls