Try another way to call the code after revalidate() buf before repaint().scrollPane.getViewport().setViewPosition(new Point(x,y));或者你可以尝试调用 panel.scrollRectToVisible(Rectangle) 这篇关于JScrollPane 自动将 ViewPort 位置设置为 (0,0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-13 06:30