How to force-refresh/repaint a JScrollPane?

后端 未结 2 1177
夕颜
夕颜 2021-01-12 14:01

I am adding lots of components (JPanels, JLabels etc.) into a JScrollPane programagically at the start of my program based on some stuff from a database.

It seems th

2条回答
  •  无人及你
    2021-01-12 14:28

    In my case only

    frame.pack();
    

    helped to get the scrollbars on the JScrollPane, when the enclosed JPanel was resized dynamically.

提交回复
热议问题