On Fri, 25 Apr 2025 18:59:35 GMT, Anass Baya <ab...@openjdk.org> wrote:

>> This test was designed to manually verify that clicking on the JComboBox 
>> when the frame containing it is about to close does not cause an 
>> IllegalStateException.
>> 
>> The test allowed the tester extra time to click on the JComboBox when 
>> closing the frame by adding a Thread.sleep() in the close button handler.
>> 
>> In this test, a JComboBox is displayed with a Close button at the bottom. 
>> The tester should click the Close button, then try to click the JComboBox 
>> arrow button to display the popup.
>> 
>> In the automated test, we save the JComboBox  location size before closing 
>> the frame. We then use this information to click on the JComboBox right 
>> before the frame is closed.
>
> Anass Baya has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Frame null-check before disposing the frame on the EDT

Changes requested by achung (Committer).

test/jdk/javax/swing/JComboBox/ComboPopupBug.java line 44:

> 42:     private static JFrame frame;
> 43:     private static JButton closeButton;
> 44:     private static JComboBox<String> comboBox;

can remove <String>

test/jdk/javax/swing/JComboBox/ComboPopupBug.java line 58:

> 56:             robot.delay(1000);
> 57: 
> 58:             SwingUtilities.invokeAndWait(() -> closeButton.doClick());

maybe add a waitForIdle after this call for stability

test/jdk/javax/swing/JComboBox/ComboPopupBug.java line 81:

> 79:         frame = new JFrame("ComboPopup");
> 80: 
> 81:         comboBox = new JComboBox<>();

comboBox = new JComboBox();

test/jdk/javax/swing/JComboBox/ComboPopupBug.java line 93:

> 91:         });
> 92: 
> 93:         frame.getContentPane().add(comboBox, "North");

dont need .getContentPane()

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

PR Review: https://git.openjdk.org/jdk/pull/24624#pullrequestreview-2795188809
PR Review Comment: https://git.openjdk.org/jdk/pull/24624#discussion_r2060835612
PR Review Comment: https://git.openjdk.org/jdk/pull/24624#discussion_r2060830432
PR Review Comment: https://git.openjdk.org/jdk/pull/24624#discussion_r2060836492
PR Review Comment: https://git.openjdk.org/jdk/pull/24624#discussion_r2060828659

Reply via email to