Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
azvegint committed Sep 25, 2023
1 parent abece69 commit 0fb799e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
6 changes: 3 additions & 3 deletions test/jdk/java/awt/Frame/DefaultSizeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* questions.
*/

import java.awt.EventQueue;
import java.awt.Frame;
import javax.swing.SwingUtilities;

/*
* @test 4033151
Expand All @@ -39,7 +39,7 @@ public class DefaultSizeTest {
It should be located to the right of this window
and should be the minimum size allowed by the window manager.
For any WM, the frame should be very small.
When the test is complete, click Pass or Fail as appropriate.
If the frame is not large, click Pass or Fail otherwise.
""";


Expand All @@ -52,7 +52,7 @@ public static void main(String[] args) throws Exception {
.columns(45)
.build();

SwingUtilities.invokeAndWait(() -> {
EventQueue.invokeAndWait(() -> {
Frame frame = new Frame("DefaultSize");

PassFailJFrame.addTestWindow(frame);
Expand Down
12 changes: 6 additions & 6 deletions test/jdk/java/awt/LightweightComponent/LightweightCliprect.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.SwingUtilities;
import java.awt.Shape;

/*
* @test
Expand All @@ -43,8 +44,8 @@
public class LightweightCliprect {

private static final String INSTRUCTIONS = """
If some text is drawn outside the red rectangle press "Fail" button.
Otherwise press "Pass" button.
If some text is drawn outside the red rectangle, press "Fail" button.
Otherwise, press "Pass" button.
""";

public static void main(String[] args) throws Exception {
Expand All @@ -56,7 +57,7 @@ public static void main(String[] args) throws Exception {
.columns(45)
.build();

SwingUtilities.invokeAndWait(() -> {
EventQueue.invokeAndWait(() -> {
Frame frame = new Frame("DefaultSize");

Container panel = new MyContainer();
Expand All @@ -83,8 +84,7 @@ public void paint(Graphics g) {
Color c = g.getColor();
g.setColor(Color.red);
g.fillRect(20, 20, 400, 200);
Rectangle clip;
clip = g.getClipBounds();
Shape clip = g.getClip();
g.setClip(20, 20, 400, 200);
//draw the current java version in the component
g.setColor(Color.black);
Expand Down
16 changes: 3 additions & 13 deletions test/jdk/javax/swing/JFrame/DefaultCloseOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,9 @@
*/

public class DefaultCloseOperation extends JPanel {
private static final String INSTRUCTIONS = """
This is a manual test (requires user interaction) which tests the
"defaultCloseOperation" property for swing's JFrame and JDialog.
This property enables a program to tell swing to automatically
handle a user's "Close" operation on a JFrame or JDialog in one of
the following ways:
- Do nothing - do not do anything when the user closes the window
- Hide - automatically hide the window when the user closes it
- Dispose - automatically dispose the window when the user closes it

To run this test, do the following steps (if an exception is thrown
at anytime during the test, the test has failed, else it passed):
private static final String INSTRUCTIONS = """
Do the following steps:
- Click the "Open Frame" button (a TestFrame will appear)
- On the TestFrame, select "Close" from the system menu (the window should go away)
Expand Down Expand Up @@ -88,7 +78,7 @@ public static void main(String[] args) throws Exception {
.title("DefaultCloseOperation Manual Test")
.instructions(INSTRUCTIONS)
.testTimeOut(5)
.rows(33)
.rows(20)
.columns(70)
.build();

Expand Down

0 comments on commit 0fb799e

Please sign in to comment.