diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 1d5125920ed..43bd9fdcde9 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -850,7 +850,6 @@ java/awt/Frame/FrameStateTest/FrameStateTest.html 8203920 macosx-all,linux-all javax/swing/SwingUtilities/TestTextPosInPrint.java 8227025 windows-all java/awt/print/PrinterJob/ScaledText/ScaledText.java 8231226 macosx-all java/awt/font/TextLayout/TestJustification.html 8250791 macosx-all -javax/swing/JTabbedPane/4209065/bug4209065.java 8251177 macosx-all java/awt/TrayIcon/DragEventSource/DragEventSource.java 8252242 macosx-all java/awt/FileDialog/DefaultFocusOwner/DefaultFocusOwner.java 7187728 macosx-all,linux-all java/awt/FileDialog/RegexpFilterTest/RegexpFilterTest.html 7187728 macosx-all,linux-all diff --git a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.html b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.html deleted file mode 100644 index 5737912f130..00000000000 --- a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - diff --git a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java index c2e2c14d7d8..4f78e73b911 100644 --- a/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java +++ b/test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2022, 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 @@ -21,37 +21,63 @@ * questions. */ -import java.awt.EventQueue; +/* + * @test + * @bug 4209065 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary To test if the style of the text on the tab matches the description. + * @run main/manual bug4209065 + */ + import java.lang.reflect.InvocationTargetException; -import javax.swing.JApplet; +import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; -/** - * @test - * @bug 4209065 - * @author Georges Saab - * @run applet/manual=yesno bug4209065.html - */ -public final class bug4209065 extends JApplet { - - @Override - public void init() { - try { - EventQueue.invokeAndWait(this::createTabbedPane); - } catch (InterruptedException | InvocationTargetException e) { - throw new RuntimeException(e); - } + +public final class bug4209065 { + + private static JFrame frame; + private static final String text = + "If the style of the text on the tabs matches the descriptions," + + "\npress PASS.\n\nNOTE: where a large font is used, the" + + " text may be larger\nthan the tab height but this is OK" + + " and NOT a failure."; + + public static void createAndShowGUI() throws InterruptedException, + InvocationTargetException { + SwingUtilities.invokeAndWait(() -> { + frame = new JFrame("JTabbedPane"); + + JTabbedPane tp = new JTabbedPane(); + + tp.addTab("
big
", + new JLabel()); + tp.addTab("
red
", + new JLabel()); + tp.addTab("
Bold Italic!
", + new JLabel()); + + frame.getContentPane().add(tp); + frame.setSize(400, 400); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + + + PassFailJFrame.addTestFrame(frame); + PassFailJFrame.positionTestFrame(frame, + PassFailJFrame.Position.HORIZONTAL); + }); } - private void createTabbedPane() { - JTabbedPane tp = new JTabbedPane(); - getContentPane().add(tp); - String text = "
If the style of the text on the tabs matches" - + "
the descriptions, press PASS
"; - tp.addTab("
big
", new JLabel(text)); - tp.addTab("
red
", new JLabel(text)); - tp.addTab("
Bold Italic!
", new JLabel(text)); + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame passFailJFrame = new PassFailJFrame("JTabbedPane " + + "Test Instructions", text, 5, 19, 35); + createAndShowGUI(); + passFailJFrame.awaitAndCheck(); } -} +} \ No newline at end of file