Scrolling limitation with JScrollPane and JViewport maximum sizes smaller than contents

后端 未结 2 1983
礼貌的吻别
礼貌的吻别 2021-01-20 21:39

I have a JFrame containing a JScrollPane containing a JPanel. The JPanel contains a bunch of JTextAreas. I\

2条回答
  •  鱼传尺愫
    2021-01-20 22:36

    The problem had nothing to do with thread safety. After much digging, I found that the underlying window manager implementation for the Look And Feel of JPanel had a hardcoded 32767 size limit, so it didn't matter that it was sitting in a JScrollPane. The idea was to avoid a lot of extra managing of individual JScrollPanes but the limit makes it unavoidable.

    Moving the contents of the JPanel into their own individual JscrollPanes resolved the issue. The scrolling is still a bit laggy for reasons unknown to me.

提交回复
热议问题