JTable column header not visible

后端 未结 4 1021
予麋鹿
予麋鹿 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:28

    The API for JTable states:

    "Note that if you wish to use a JTable in a standalone view (outside of a JScrollPane) and want the header displayed, you can get it using getTableHeader() and display it separately."

    Or just add the table to a scrollpane, and add your scrollpane to the panel...

提交回复
热议问题