jdk/test/javax/swing/ToolTipManager/Test6256140.java
author yan
Fri, 21 Nov 2014 16:11:03 +0300
changeset 28071 3acb75b8df45
parent 10873 b4a797aab8d1
child 40128 e635645d2a8a
permissions -rw-r--r--
8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2 8064573: [TEST_BUG] javax/swing/text/AbstractDocument/6968363/Test6968363.java is asocial pressing VK_LEFT and not releasing 8064575: [TEST_BUG] javax/swing/JEditorPane/6917744/bug6917744.java 100 times press keys and never releases 8064809: [TEST_BUG] javax/swing/JComboBox/4199622/bug4199622.java contains a lot of keyPress and not a single keyRelease Reviewed-by: alexsch, pchelko
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     1
/*
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     2
 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     4
 *
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     8
 *
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    13
 * accompanied this code).
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    14
 *
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    18
 *
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    21
 * questions.
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    22
 */
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    23
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    24
/*
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    25
 * @test
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    26
 * @bug 6256140
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    27
 * @summary Esc key doesn't restore old value in JFormattedtextField when ToolTip is set
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    28
 * @author Alexander Potochkin
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    29
 * @run main Test6256140
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    30
 */
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    31
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    32
import javax.swing.*;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    33
import java.awt.*;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    34
import java.awt.event.KeyEvent;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    35
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    36
public class Test6256140 {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    37
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    38
    private static volatile JFormattedTextField ft;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    39
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    40
    private final static String initialText = "value";
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    41
    private final static JLabel toolTipLabel = new JLabel("tip");
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    42
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    43
    public static void main(String[] args) throws Exception {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    44
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    45
        Robot robot = new Robot();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    46
        robot.setAutoDelay(10);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    47
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    48
        SwingUtilities.invokeAndWait(new Runnable() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    49
            public void run() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    50
                createAndShowGUI();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    51
            }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    52
        });
28071
3acb75b8df45 8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents: 10873
diff changeset
    53
        robot.waitForIdle();
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    54
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    55
        Point point = ft.getLocationOnScreen();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    56
        robot.mouseMove(point.x, point.y);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    57
        robot.mouseMove(point.x + 3, point.y + 3);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    58
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    59
        robot.keyPress(KeyEvent.VK_A);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    60
        robot.keyRelease(KeyEvent.VK_A);
28071
3acb75b8df45 8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents: 10873
diff changeset
    61
        robot.waitForIdle();
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    62
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    63
        if (!isTooltipShowning()) {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    64
            throw new RuntimeException("Tooltip is not shown");
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    65
        }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    66
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    67
        robot.keyPress(KeyEvent.VK_ESCAPE);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    68
        robot.keyRelease(KeyEvent.VK_ESCAPE);
28071
3acb75b8df45 8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents: 10873
diff changeset
    69
        robot.waitForIdle();
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    70
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    71
        if (isTooltipShowning()) {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    72
            throw new RuntimeException("Tooltip must be hidden now");
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    73
        }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    74
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    75
        if (isTextEqual()) {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    76
            throw new RuntimeException("FormattedTextField must *not* cancel the updated value this time");
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    77
        }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    78
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    79
        robot.keyPress(KeyEvent.VK_ESCAPE);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    80
        robot.keyRelease(KeyEvent.VK_ESCAPE);
28071
3acb75b8df45 8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents: 10873
diff changeset
    81
        robot.waitForIdle();
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    82
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    83
        if (!isTextEqual()) {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    84
            throw new RuntimeException("FormattedTextField must cancel the updated value");
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    85
        }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    86
    }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    87
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    88
    private static boolean isTooltipShowning() throws Exception {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    89
        final boolean[] result = new boolean[1];
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    90
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    91
        SwingUtilities.invokeAndWait(new Runnable() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    92
            @Override
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    93
            public void run() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    94
                result[0] = toolTipLabel.isShowing();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    95
            }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    96
        });
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    97
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    98
        return result[0];
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    99
    }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   100
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   101
    private static boolean isTextEqual() throws Exception {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   102
        final boolean[] result = new boolean[1];
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   103
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   104
        SwingUtilities.invokeAndWait(new Runnable() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   105
            @Override
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   106
            public void run() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   107
                result[0] = initialText.equals(ft.getText());
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   108
            }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   109
        });
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   110
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   111
        return result[0];
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   112
    }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   113
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   114
    private static void createAndShowGUI() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   115
        ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   116
        ToolTipManager.sharedInstance().setInitialDelay(0);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   117
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   118
        final JFrame frame = new JFrame();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   119
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   120
        frame.setLayout(new FlowLayout());
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   121
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   122
        ft = new JFormattedTextField() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   123
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   124
            public JToolTip createToolTip() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   125
                JToolTip toolTip = super.createToolTip();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   126
                toolTip.setLayout(new BorderLayout());
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   127
                toolTip.add(toolTipLabel);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   128
                return toolTip;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   129
            }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   130
        };
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   131
        ft.setToolTipText("   ");
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   132
        ft.setValue(initialText);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   133
        frame.add(ft);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   134
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   135
        frame.pack();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   136
        frame.setLocationRelativeTo(null);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   137
        frame.setVisible(true);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   138
        ft.requestFocus();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   139
    }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   140
}