jdk/test/javax/swing/ToolTipManager/Test6256140.java
author hseigel
Wed, 01 Mar 2017 08:00:02 -0500
changeset 46194 5596e6f63072
parent 40128 e635645d2a8a
permissions -rw-r--r--
8172307: Remove ununsed JVM API JVM_GetModuleByPackageName() Summary: Remove get_module_by_package_name() etc., and unneeded test. Reviewed-by: sspitsyn, gtriantafill
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
40128
e635645d2a8a 8160974: [TESTBUG] Mark more headful tests with @key headful.
goetz
parents: 28071
diff changeset
    26
 * @key headful
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    27
 * @bug 6256140
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    28
 * @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
    29
 * @author Alexander Potochkin
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    30
 * @run main Test6256140
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
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    33
import javax.swing.*;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    34
import java.awt.*;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    35
import java.awt.event.KeyEvent;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    36
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    37
public class Test6256140 {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    38
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    39
    private static volatile JFormattedTextField ft;
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    40
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    41
    private final static String initialText = "value";
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    42
    private final static JLabel toolTipLabel = new JLabel("tip");
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    43
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    44
    public static void main(String[] args) throws Exception {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    45
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    46
        Robot robot = new Robot();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    47
        robot.setAutoDelay(10);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    48
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    49
        SwingUtilities.invokeAndWait(new Runnable() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    50
            public void run() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    51
                createAndShowGUI();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    52
            }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    53
        });
28071
3acb75b8df45 8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents: 10873
diff changeset
    54
        robot.waitForIdle();
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    55
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    56
        Point point = ft.getLocationOnScreen();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    57
        robot.mouseMove(point.x, point.y);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    58
        robot.mouseMove(point.x + 3, point.y + 3);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    59
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    60
        robot.keyPress(KeyEvent.VK_A);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    61
        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
    62
        robot.waitForIdle();
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    63
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    64
        if (!isTooltipShowning()) {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    65
            throw new RuntimeException("Tooltip is not shown");
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
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    68
        robot.keyPress(KeyEvent.VK_ESCAPE);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    69
        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
    70
        robot.waitForIdle();
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    71
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    72
        if (isTooltipShowning()) {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    73
            throw new RuntimeException("Tooltip must be hidden now");
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
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    76
        if (isTextEqual()) {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    77
            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
    78
        }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    79
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    80
        robot.keyPress(KeyEvent.VK_ESCAPE);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    81
        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
    82
        robot.waitForIdle();
10873
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    83
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    84
        if (!isTextEqual()) {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    85
            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
    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
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    89
    private static boolean isTooltipShowning() throws Exception {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    90
        final boolean[] result = new boolean[1];
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    91
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    92
        SwingUtilities.invokeAndWait(new Runnable() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    93
            @Override
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    94
            public void run() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    95
                result[0] = toolTipLabel.isShowing();
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
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
    99
        return result[0];
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
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   102
    private static boolean isTextEqual() throws Exception {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   103
        final boolean[] result = new boolean[1];
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   104
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   105
        SwingUtilities.invokeAndWait(new Runnable() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   106
            @Override
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   107
            public void run() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   108
                result[0] = initialText.equals(ft.getText());
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
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   112
        return result[0];
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
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   115
    private static void createAndShowGUI() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   116
        ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   117
        ToolTipManager.sharedInstance().setInitialDelay(0);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   118
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   119
        final JFrame frame = new JFrame();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   120
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   121
        frame.setLayout(new FlowLayout());
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   122
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   123
        ft = new JFormattedTextField() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   124
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   125
            public JToolTip createToolTip() {
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   126
                JToolTip toolTip = super.createToolTip();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   127
                toolTip.setLayout(new BorderLayout());
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   128
                toolTip.add(toolTipLabel);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   129
                return toolTip;
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
        };
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   132
        ft.setToolTipText("   ");
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   133
        ft.setValue(initialText);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   134
        frame.add(ft);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   135
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   136
        frame.pack();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   137
        frame.setLocationRelativeTo(null);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   138
        frame.setVisible(true);
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   139
        ft.requestFocus();
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   140
    }
b4a797aab8d1 6624077: Regression test fails: closed/javax/swing/ToolTipManager/6256140/bug6256140.java
rupashka
parents:
diff changeset
   141
}