Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Time {
- ActionListener action = new ActionListener(){
- @Override
- public void actionPerformed(ActionEvent e) {
- count += 1;
- //System.out.println(count);
- if(count > 1){
- t.stop();
- }
- }
- };
- public Timer t = new Timer(2000, action);
- public int count;
- public void start(){
- t.start();
- }
- public void stop(){
- t.stop();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment