On Tue, 1 Apr 2025 23:24:57 GMT, Phil Race <p...@openjdk.org> wrote:

> open sourcing some Swing JTabbedPane tests

test/jdk/javax/swing/JTabbedPane/bug4273320.java line 57:

> 55: 
> 56:             TabbedPaneUI ui = tabs.getUI();
> 57:             Rectangle origSize = ui.getTabBounds(tabs, 0);

On EDT ?

test/jdk/javax/swing/JTabbedPane/bug4287268.java line 59:

> 57:             Point point = jtp.getLocationOnScreen();
> 58:             int width = jtp.getWidth();
> 59:             int height = jtp.getHeight();

Might be good to wrap it in EDT. 

It was the following `getComponentBounds()` method that @azvegint suggested we 
move to Util (since we use it across multiple tests), but it does create a 
dependency on Util class.


Rectangle jtpLoc = Util.invokeOnEDT(() ->
                                        getComponentBounds(jtp));

private static Rectangle getComponentBounds(Component component) {
        Point locationOnScreen = component.getLocationOnScreen();
        Dimension size = component.getSize();
        return new Rectangle(locationOnScreen, size);
}

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24370#discussion_r2027692877
PR Review Comment: https://git.openjdk.org/jdk/pull/24370#discussion_r2027691580

Reply via email to