Skip to content

Commit fddaac9

Browse files
author
duke
committed
Backport 759cc675915c551cc1d6899eedb95900752f2703
1 parent 410a563 commit fddaac9

File tree

2 files changed

+27
-41
lines changed

2 files changed

+27
-41
lines changed

test/jdk/javax/swing/border/Test6910490.html

Lines changed: 0 additions & 32 deletions
This file was deleted.

test/jdk/javax/swing/border/Test6910490.java

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 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
@@ -27,8 +27,8 @@
2727
import java.awt.Graphics;
2828
import java.awt.Insets;
2929
import javax.swing.Icon;
30-
import javax.swing.JApplet;
3130
import javax.swing.JButton;
31+
import javax.swing.JFrame;
3232
import javax.swing.JScrollPane;
3333
import javax.swing.JSplitPane;
3434
import javax.swing.border.MatteBorder;
@@ -37,22 +37,40 @@
3737
* @test
3838
* @bug 6910490
3939
* @summary Tests a matte border around a component inside a scroll pane.
40-
* @author Sergey Malenkov
41-
* @run applet/manual=yesno Test6910490.html
40+
* @library /java/awt/regtesthelpers
41+
* @build PassFailJFrame
42+
* @run main/manual Test6910490
4243
*/
4344

44-
public class Test6910490 extends JApplet implements Icon {
45+
public class Test6910490 implements Icon {
46+
public static void main(String[] args) throws Exception {
47+
String testInstructions = """
48+
If the border is painted over scroll bars then test fails.
49+
Otherwise test passes.""";
50+
Test6910490 obj = new Test6910490();
51+
PassFailJFrame.builder()
52+
.title("Test Instructions")
53+
.instructions(testInstructions)
54+
.rows(3)
55+
.columns(35)
56+
.testUI(obj.initializeTest())
57+
.build()
58+
.awaitAndCheck();
59+
}
4560

46-
@Override
47-
public void init() {
61+
public JFrame initializeTest() {
4862
Insets insets = new Insets(10, 10, 10, 10);
49-
Dimension size = new Dimension(getWidth() / 2, getHeight());
63+
JFrame frame = new JFrame("Matte Border Test");
64+
frame.setSize(600, 300);
65+
Dimension size = new Dimension(frame.getWidth() / 2, frame.getHeight());
5066
JSplitPane pane = new JSplitPane(
5167
JSplitPane.HORIZONTAL_SPLIT,
5268
create("Color", size, new MatteBorder(insets, RED)),
5369
create("Icon", size, new MatteBorder(insets, this)));
70+
5471
pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
55-
add(pane);
72+
frame.add(pane);
73+
return frame;
5674
}
5775

5876
private JScrollPane create(String name, Dimension size, MatteBorder border) {

0 commit comments

Comments
 (0)