/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package j;

import java.util.Timer;
import java.util.TimerTask;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;

public class Timer0 extends Canvas {
public static int countervector=0;
public static String SSS="";

public static int CC=0;
public static int coin0=0; 
public static int coin1=0; 
public static int coin2=0; 
public static int coin3=0; 
public static boolean Flag0=true; 
public static Command Command10;
public static Command Command9;




public static void Start3(){
   
Command9 = new Command("LL",Command.EXIT,0);
Command10 = new Command("RR",Command.OK,1);

Midlet0.canvas2.addCommand(Command10);
Midlet0.canvas2.addCommand(Command9);
 j.Midlet0.canvas2.setCommandListener(new CommandListener() {
     

    public void commandAction(Command c, Displayable d) {
  
      // j.RW0.printing("Comma:: ");
        if(c==Command9) {
                                //j.RW0.printing("Left:: ", Screen0.F0);
                                j.Screen0.display.setCurrent(j.Midlet0.canvas0);  
                                CC++;
        }
        
        if(c==Command10){
                               //j.RW0.printing("Reght:: ", Screen0.F0);
                               j.Screen0.display.setCurrent(j.Midlet0.canvas2);  
                               }
                                                         }
                             });
  
    Timer aTimer = new Timer();
            TimerTask ttask = new TimerTask() {
                public void run() {
                   //System.out.println(countervector);
                  // countervector++;
                    if(Flag0==true){
                   
                   SSS=coin3+":"+coin2+":"+coin1+":"+coin0;
                   //System.out.println(SSS+""+countervector);
                   
                   if(coin0>=60){coin0=0;coin1++;}
                   if(coin1>=60){coin1=0;coin2++;}
                   if(coin2>=24){coin2=0;coin3++;}
                   //countervector
                   coin0++;
                   countervector++;
                  
                 
                   
                }}
            };
            aTimer.schedule(ttask,0, 1000);
}  



    protected void paint(Graphics g) {
        g.setColor(0,0,0);
        g.fillRect(0, 0, 444, 377);
        g.setColor(233,200,250);
        g.drawString( SSS , 50, 225,g.TOP|g.LEFT);
        for(int i=0;i<=CC;i++){
        g.drawString( countervector+"" , 50,265, g.TOP|g.LEFT);
        
        }                                                                          
        
        repaint();
    }

}