Skip to content

Instantly share code, notes, and snippets.

@sjh836
sjh836 / TimerStudy.java
Created March 18, 2017 15:30
javax.swing.Timer 로 이벤트 반복2
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();
@sjh836
sjh836 / TimerStudyApp.java
Created March 18, 2017 15:29
javax.swing.Timer 로 이벤트 반복1
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");