private class RdQuotationBOMCheckBoxRenderer extends JPanel implements TableCellRenderer { private static final long serialVersionUID = 1L; public RdQuotationBOMCheckBoxRenderer() { super(); setSize(400, 300); //setHorizontalAlignment(SwingConstants.CENTER); } @Override public Component getTableCellRendererComponent(final JTable table, Object value, boolean isSelected, boolean hasFocus, final int row,final int column) { JPanel panel = new JPanel(); panel.setPreferredSize(new Dimension(200,200)); }
JTable的行高度和自定义的渲染控件无关。就算设置的panel.setPreferredSize(new Dimension(200,200));也没有用
只是和单元格的的内容有关。\n\n用于单元格内容的换行