11/*
2- * Copyright (c) 1999, 2024 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 1999, 2025 , 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
2727import java .awt .TextField ;
2828import java .awt .event .ActionEvent ;
2929import java .awt .event .ActionListener ;
30- import java .lang .reflect .InvocationTargetException ;
3130
3231/*
3332 * @test
@@ -54,16 +53,17 @@ public class SetEchoCharTest4 extends Frame implements ActionListener {
5453
5554 Make sure the actual text matches what you typed in for each field.
5655 Press Pass if everything's ok, otherwise Fail
57- """ ;
56+ """ ;
5857
5958 public SetEchoCharTest4 () {
59+ super ("SetEchoCharTest4" );
6060 setLayout (new FlowLayout ());
6161 tf1 .setEchoChar ('*' );
6262 tf2 .setEchoChar ('$' );
6363 tf3 .setEchoChar ('#' );
6464 addStuff ();
6565 b .addActionListener (this );
66- setSize (200 , 200 );
66+ setSize (300 , 150 );
6767 }
6868
6969 private void addStuff () {
@@ -78,24 +78,21 @@ public void actionPerformed(ActionEvent ae) {
7878 PassFailJFrame .log ("TextField2 = " + tf2 .getText ());
7979 PassFailJFrame .log ("TextField3 = " + tf3 .getText ());
8080 PassFailJFrame .log ("--------------" );
81- setVisible (false );
8281 remove (tf1 );
8382 remove (tf2 );
8483 remove (tf3 );
8584 remove (b );
8685 addStuff ();
8786 }
8887
89- public static void main (String [] args ) throws InterruptedException ,
90- InvocationTargetException {
88+ public static void main (String [] args ) throws Exception {
9189 PassFailJFrame .builder ()
92- .title ("Set Echo Character Test" )
93- .testUI (SetEchoCharTest4 ::new )
94- .instructions (INSTRUCTIONS )
95- .rows ((int ) INSTRUCTIONS .lines ().count () + 1 )
96- .columns (40 )
97- .logArea ()
98- .build ()
99- .awaitAndCheck ();
90+ .title ("Set Echo Character Test" )
91+ .testUI (SetEchoCharTest4 ::new )
92+ .instructions (INSTRUCTIONS )
93+ .columns (40 )
94+ .logArea ()
95+ .build ()
96+ .awaitAndCheck ();
10097 }
10198}
0 commit comments