This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.util.Date; | |
class TimerStudy implements ActionListener | |
{ | |
int n=0; | |
public void actionPerformed(ActionEvent e) { | |
Date date=new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.ActionListener; | |
import javax.swing.Timer; | |
public class TimerStudyApp { | |
public static void main(String[] args) { | |
ActionListener listener = new TimerStudy(); | |
Timer t=new Timer(2000, listener); | |
t.start(); | |
System.out.println("메인쓰레드 START"); |