如何让 JSplitPane 平滑移动?

How do I let a JSplitPane move smooth?

我有一个简单的 Java Swing GUI,其中 JSplitPane 用于划分两个 JPanel。现在我想知道如何让它平滑移动,以便在调整 window 大小时可以看到它移动。标准设置非常丑陋,因为 JSplitPane 只有在您释放它时才会移动。 我花了很多时间寻找类似的东西。

ClassJSplitPane里面有没有什么功能可以平滑移动的?

我相信你正在寻找JSplitPane#setContinuousLayout

Sets the value of the continuousLayout property, which must be true for the child components to be continuously redisplayed and laid out during user intervention. The default value of this property is look and feel dependent. Some look and feels might not support continuous layout; they will ignore this property.