public class HiwayTest7 { public static void main(String...args){
JFrame frame = new JFrame("AdvancedJTable");
String[][] rowDatas = new String[][]{{"5","1","7","4"},{"11","0","9","3"}};
String[] columnDatas = new String[]{"A","B","C","D"};
JTable table = new JTable(rowDatas,columnDatas);
table.removeColumn(new TableColumn(1));
// table.setPreferredSize(new Dimension(800,300));
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.updateUI();
frame.setContentPane(new JScrollPane(table));
frame.setBounds(new Rectangle(10,10,800,600));
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}Hello,every body :
    run the application above, we can use mouse to resize the columns' size, if we make the commented line uncommented, it becomes hard to resize column'size by mouse(it seems resize doesn't work,but sometimes we can resize uncontrollably).Can you tell me why ?  Thank you 

解决方案 »

  1.   

    to 1L:
    呵呵,我是中国人,想锻炼下e文不过,这些英文都是常见的词语,静下心来看不难的3Q
      

  2.   

    怀疑LZ是来问问题的,还是show英文的!
      

  3.   

    晕倒,秀英文至于吗说中文好了各位大神,帮我解决下问题啊。大家可以运行下上面的程序,体验下
    //        table.setPreferredSize(new Dimension(800,300));
    这句注不注释 对 拖动列宽的影响多谢