Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8253980: javax/swing/plaf/synth/7158712/bug7158712.java fails on windows #500

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Expand Up @@ -834,7 +834,6 @@ javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.ja
javax/swing/JMenuItem/6249972/bug6249972.java 8233640 macosx-all
javax/swing/JMenuItem/4171437/bug4171437.java 8233641 macosx-all
javax/swing/JMenu/4692443/bug4692443.java 8171998 macosx-all
javax/swing/plaf/synth/7158712/bug7158712.java 8238720 windows-all
javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8238720 windows-all

sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all,macosx-all
Expand Down
19 changes: 13 additions & 6 deletions test/jdk/javax/swing/plaf/synth/7158712/bug7158712.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,2020 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,13 +27,19 @@
* @bug 7158712
* @summary Synth Property "ComboBox.popupInsets" is ignored
* @library ../../../regtesthelpers
* @author Pavel Porvatov
* @run main/othervm -Dsun.java2d.uiScale=1 bug7158712
*/

import javax.swing.*;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.synth.SynthLookAndFeel;
import java.awt.*;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Robot;
import java.awt.Point;
import java.awt.event.InputEvent;
import java.io.ByteArrayInputStream;
import java.util.concurrent.Callable;
Expand All @@ -59,15 +65,15 @@ public class bug7158712 {
public static void main(String[] args) throws Exception {
Robot robot = new Robot();

robot.setAutoDelay(500);
robot.setAutoDelay(100);

SynthLookAndFeel laf = new SynthLookAndFeel();

laf.load(new ByteArrayInputStream(SYNTH_XML.getBytes("UTF8")), bug7158712.class);

UIManager.setLookAndFeel(laf);

EventQueue.invokeAndWait(new Runnable() {
SwingUtilities.invokeAndWait(new Runnable() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW the EventQueue is the right thing to use.

public void run() {
comboBox = new JComboBox<>(
new String[]{"Very Looooooooooooooooooooong Text Item 1", "Item 2"});
Expand All @@ -83,6 +89,7 @@ public void run() {
});

robot.waitForIdle();
robot.delay(1000);

Point comboBoxLocation = Util.invokeOnEDT(new Callable<Point>() {
@Override
Expand Down