-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.5.1
Name: aaC67449 Date: 02/11/98
java.awt.swing.Timer does not start under appletviewer.
This bug appears in JDK-1.2beta3-F. It works correctly in earlier versions.
-------------------Example-----------------------------------
import java.awt.swing.*;
import java.awt.event.*;
import java.applet.*;
public class Test1 extends Applet{
boolean flag=false;
public void init() {
ActionListener l=new ActionListener(){
public void actionPerformed(ActionEvent e){
System.out.println("Passed");
flag=true;
}
};
Timer c= new Timer(100,l);
c.setRepeats(false);
c.start(); // start timer
try {
Thread.sleep(1000); // wait
} catch(InterruptedException e) {
System.out.println("Unexpected "+e);
}
if(!flag) // verify the timer worked
System.out.println("Failed");
}
public static void main(String argv[]) {
(new Test1()).init();
}
}
-------------------Output------------------------------------
# Under appletviewer
#>appletviewer test1.html
Failed
^C
#>java Test1
Passed
^C
======================================================================