re-size JTable when useing Default table model

前端 未结 2 967
暗喜
暗喜 2020-12-21 17:00

I have a JTable built using DefaultModel which is displayed in JPane but I would like to re-size the table to make it bigger. Could any one please explain how I could do tha

2条回答
  •  旧时难觅i
    2020-12-21 17:42

    Using setPreferredSize() is problematic. Because JTable implements Scrollable, overriding getPreferredScrollableViewportSize() to return a multiple of getRowHeight() may be a better approach.

提交回复
热议问题