JPanel jpanel=new JPanel();
jpanel.setBorder(BorderFactory.createTitledBorder("起首台词"));
jpanel.setLayout(null);
JTable table=new JTable(3,2);
table.setBounds(12,20,342,200);
jpanel.add(table);
现在应该是生成了三行两列的表格,如何去调整列的宽度呢? 小弟新手 请指教...
jpanel.setBorder(BorderFactory.createTitledBorder("起首台词"));
jpanel.setLayout(null);
JTable table=new JTable(3,2);
table.setBounds(12,20,342,200);
jpanel.add(table);
现在应该是生成了三行两列的表格,如何去调整列的宽度呢? 小弟新手 请指教...
protected int rowMargin 每行中单元格之间间距的高度,以像素为单位。 供参考!
col.setPreferredWidth(100);