RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog()

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon May 19 06:14:37 UTC 2025


The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. 
This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user.
Fixed by setting the divider location before rendering the left and right components..

-------------

Commit messages:
 - jcheck
 - 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog()

Changes: https://git.openjdk.org/jdk/pull/25294/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356594
  Stats: 161 lines in 2 files changed: 160 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/25294.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25294/head:pull/25294

PR: https://git.openjdk.org/jdk/pull/25294


More information about the client-libs-dev mailing list