On Mon, 17 Jun 2024 05:07:22 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
>> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java >> line 369: >> >>> 367: @Override >>> 368: public void setEnabled(boolean enabled) { >>> 369: if (splitPane.isOneTouchExpandable() && >> >> i think for setEnabled the buttons should be enabled/disabled regardless of >> if splitPane isOneTouchExpandable is true so that the state is preserved >> even if setEnabled(false) is called before >> setOneTouchExpandable(true) > > No, the left and right arrow buttons are created ONLY when > `isOneTouchExpandable` is true so it should be checked here too to > enable/disable actions Alisen's concern is valid. What if `setEnabled(false)` is called when `isOneTouchExpandable` is `false` and then `setOneTouchExpandable(true)` is called which adds the buttons? The buttons are enabled when they should be disabled. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1646653721