JTable column header not visible

后端 未结 4 1019
予麋鹿
予麋鹿 2021-01-07 16:48

column header not visible in my JTable i have created a JPanel and added the JTable to the JPanel.

Object rowData[][] = { { \"Row1-Column1\", \"Row1-Column2\         


        
4条回答
  •  走了就别回头了
    2021-01-07 17:40

    You can add following code into your code

    DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
    renderer.setPreferredSize(new Dimension(0, 0));
    table.getTableHeader().setDefaultRenderer(renderer);
    

提交回复
热议问题