RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v4]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Wed May 28 03:23:51 UTC 2025
On Wed, 28 May 2025 02:38:07 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> If we call setComponentOrientation in test (like in TestSplitPaneOrientationTest.java which was added for JDK-4265389) then this check would fail as ComponentOrientation object would change if we call super.setComponentOrientation outside the if block (that is because `setComponentOrientation `stores the passed orientation so `this.getComponentOrientation` would always be same as `orientation `after `super.setComponentOrientation `call) and so left/right component would not be set..
>> Also, the initial fix didn't have the ComponentOrientation support so that code is anyway redundant..
>
> But we can read/save orientation, then call super, then make a check?
> I am not sure how important to always call super.setComponentOrientation(orientation);
> can we miss some notification fired from that method?
OK. Current orientation is stored and then checked and super.setComponentOrientation is called before check.
I guess that method fires PropertyChangeEvent for orientation set and now it will be fired always like before..
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2110805437
More information about the client-libs-dev
mailing list