11/*
2- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2626import java .awt .GridBagConstraints ;
2727import java .awt .GridBagLayout ;
2828
29- import javax .swing .JApplet ;
3029import javax .swing .JFrame ;
3130import javax .swing .JLabel ;
3231import javax .swing .JScrollBar ;
3736 * @test
3837 * @bug 8039464
3938 * @summary Tests enabling/disabling of titled border's caption
40- * @author Sergey Malenkov
41- * @run applet/manual=yesno Test8039464.html
39+ * @library /java/awt/regtesthelpers
40+ * @build PassFailJFrame
41+ * @run main/manual Test8039464
4242 */
4343
44- public class Test8039464 extends JApplet {
44+ public class Test8039464 {
45+ private static final String INSTRUCTIONS = """
46+ If the scrollbar thumb is painted correctly in system lookandfeel
47+ click Pass else click Fail. """ ;
48+
4549 static {
4650 try {
4751 UIManager .setLookAndFeel (UIManager .getSystemLookAndFeelClassName ());
@@ -50,11 +54,6 @@ public class Test8039464 extends JApplet {
5054 }
5155 }
5256
53- @ Override
54- public void init () {
55- init (this );
56- }
57-
5857 private static void init (Container container ) {
5958 container .setLayout (new GridBagLayout ());
6059 GridBagConstraints gbc = new GridBagConstraints ();
@@ -77,16 +76,20 @@ private static void init(Container container) {
7776 }
7877
7978 public static void main (String [] args ) throws Exception {
80- SwingUtilities .invokeLater (new Runnable () {
81- @ Override
82- public void run () {
83- JFrame frame = new JFrame ("8039464" );
84- init (frame );
85- frame .setDefaultCloseOperation (JFrame .DISPOSE_ON_CLOSE );
86- frame .pack ();
87- frame .setLocationRelativeTo (null );
88- frame .setVisible (true );
89- }
90- });
79+ PassFailJFrame .builder ()
80+ .title ("JScrollBar Instructions" )
81+ .instructions (INSTRUCTIONS )
82+ .rows (5 )
83+ .columns (35 )
84+ .testUI (Test8039464 ::createTestUI )
85+ .build ()
86+ .awaitAndCheck ();
87+ }
88+
89+ private static JFrame createTestUI () {
90+ JFrame frame = new JFrame ("8039464" );
91+ init (frame );
92+ frame .pack ();
93+ return frame ;
9194 }
9295}
0 commit comments