JTable sizing issue

后端 未结 2 1523
闹比i
闹比i 2021-01-29 01:42

I am having an issue with JTables I know my code is a little hard to follow, it\'s also a little jumbled around because it\'s coming from a fairly big program. And yes I just le

2条回答
  •  自闭症患者
    2021-01-29 02:18

    What exactly does the setPreferredScrollableViewportSize do? Does it just force the table to always be that size? What is the whole pack thing?

    The getPreferredScrollableViewportSize() method is defined in the Scrollable interface, discussed in Implementing a Scrolling-Savvy Client. Rather than setting the preferred size, you can override getPreferredScrollableViewportSize() to change the default. Making the height a multiple of getRowHeight() is illustrated here. More on preferred size may be found here. Conveniently, the pack() method "Causes this Window to be sized to fit the preferred size and layouts of its subcomponents."

提交回复
热议问题