Re: RFR: 4459231: Focus of JTabbedPane(with Scrollable tablayout) changes on change in LookAndFeel [v2]

2025-12-09 Thread Prasanta Sadhukhan
On Tue, 9 Dec 2025 09:28:29 GMT, Tejesh R  wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   test fix
>
> test/jdk/javax/swing/JTabbedPane/TabbedPaneBugWithLNF.java line 27:
> 
>> 25:  * @test
>> 26:  * @bug 4459231
>> 27:  * @summary Verifies getBaseline causes NPE for Nimbus L&F
> 
> Summary is different, please update the summary.

fixed

> test/jdk/javax/swing/JTabbedPane/TabbedPaneBugWithLNF.java line 46:
> 
>> 44: private static JTabbedPane tabPane;
>> 45: private static JButton testBtn;
>> 46: private String labelOfCurrentJBtn = null;
> 
> `labelOfCurrentJBtn ` is unused.

removed

> test/jdk/javax/swing/JTabbedPane/TabbedPaneBugWithLNF.java line 109:
> 
>> 107: return frame;
>> 108: }
>> 109: }
> 
> I don't see any empty line here.

added

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28571#discussion_r2601895390
PR Review Comment: https://git.openjdk.org/jdk/pull/28571#discussion_r2601895795
PR Review Comment: https://git.openjdk.org/jdk/pull/28571#discussion_r2601896260


Re: RFR: 4459231: Focus of JTabbedPane(with Scrollable tablayout) changes on change in LookAndFeel [v2]

2025-12-09 Thread Tejesh R
On Mon, 1 Dec 2025 09:46:35 GMT, Prasanta Sadhukhan  
wrote:

>> On changing LookAndFeel of JTabbedPane, it resets the focus of the child 
>> tabs to starting child tab.
>> That is, if a JTabbedPane has say 10 tabs and we select the 10th tab and 
>> then we change the L&F, the focus is shifted to Tab0 even though the 
>> selected tab is still at 10th tab.
>> 
>> This is because when we switch L&F, `installUI ` will reset the `focusIndex 
>> ` 
>> https://github.com/openjdk/jdk/blob/3481252ced7c06c44154ceccc56b12cfd9a490c3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java#L285-L290
>> 
>> which needs to set the proper focus by calling `scrollRectToVisible ` to 
>> selected tab which is done in this fix.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   test fix

test/jdk/javax/swing/JTabbedPane/TabbedPaneBugWithLNF.java line 27:

> 25:  * @test
> 26:  * @bug 4459231
> 27:  * @summary Verifies getBaseline causes NPE for Nimbus L&F

Summary is different, please update the summary.

test/jdk/javax/swing/JTabbedPane/TabbedPaneBugWithLNF.java line 46:

> 44: private static JTabbedPane tabPane;
> 45: private static JButton testBtn;
> 46: private String labelOfCurrentJBtn = null;

`labelOfCurrentJBtn ` is unused.

test/jdk/javax/swing/JTabbedPane/TabbedPaneBugWithLNF.java line 109:

> 107: return frame;
> 108: }
> 109: }

I don't see any empty line here.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28571#discussion_r2601789679
PR Review Comment: https://git.openjdk.org/jdk/pull/28571#discussion_r2601846046
PR Review Comment: https://git.openjdk.org/jdk/pull/28571#discussion_r2601855141


Re: RFR: 4459231: Focus of JTabbedPane(with Scrollable tablayout) changes on change in LookAndFeel [v2]

2025-12-03 Thread Alexander Zuev
On Mon, 1 Dec 2025 09:46:35 GMT, Prasanta Sadhukhan  
wrote:

>> On changing LookAndFeel of JTabbedPane, it resets the focus of the child 
>> tabs to starting child tab.
>> That is, if a JTabbedPane has say 10 tabs and we select the 10th tab and 
>> then we change the L&F, the focus is shifted to Tab0 even though the 
>> selected tab is still at 10th tab.
>> 
>> This is because when we switch L&F, `installUI ` will reset the `focusIndex 
>> ` 
>> https://github.com/openjdk/jdk/blob/3481252ced7c06c44154ceccc56b12cfd9a490c3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java#L285-L290
>> 
>> which needs to set the proper focus by calling `scrollRectToVisible ` to 
>> selected tab which is done in this fix.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   test fix

Looks good.

-

Marked as reviewed by kizune (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28571#pullrequestreview-3537030091


Re: RFR: 4459231: Focus of JTabbedPane(with Scrollable tablayout) changes on change in LookAndFeel [v2]

2025-12-01 Thread Prasanta Sadhukhan
> On changing LookAndFeel of JTabbedPane, it resets the focus of the child tabs 
> to starting child tab.
> That is, if a JTabbedPane has say 10 tabs and we select the 10th tab and then 
> we change the L&F, the focus is shifted to Tab0 even though the selected tab 
> is still at 10th tab.
> 
> This is because when we switch L&F, `installUI ` will reset the `focusIndex ` 
> https://github.com/openjdk/jdk/blob/3481252ced7c06c44154ceccc56b12cfd9a490c3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java#L285-L290
> 
> which needs to set the proper focus by calling `scrollRectToVisible ` to 
> selected tab which is done in this fix.

Prasanta Sadhukhan has updated the pull request incrementally with one 
additional commit since the last revision:

  test fix

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/28571/files
  - new: https://git.openjdk.org/jdk/pull/28571/files/c9ec06b6..f110cc52

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28571&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28571&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28571.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28571/head:pull/28571

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