ScrollBar movement not smooth in JScrollpane in Swing

后端 未结 3 1628
予麋鹿
予麋鹿 2021-01-20 15:39

I have a situation like this. I have scrollpane whose viewportView is a JPanel And that JPanel has the layout as BoxLayout. In this panel I add one class which extends JPane

3条回答
  •  无人及你
    2021-01-20 16:35

    It is never good to populate such huge no. of rows in JScrollPane. Because, the visible portion is only around let's say 20 to 30 rows in viewport depending on the height of the scrollpane and the height of your RowPanel. So, why to populate such huge rows at once ? The problem with the smoothness is because there might be exception (see the console ). So, resolve this, I see two options for you. One is to use pagination and another is to allow users to enter some search criteria to filter out the unwanted records.

提交回复
热议问题