Difference between revisions of "Scratch"

From MyWiki
Jump to: navigation, search
(Blanked the page)
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
http://crackednoodle.com/2013/01/blu-ray-ripping-on-fedora-18/
 
  
yum install *fmpeg-devel*
 
 
yum install gcc-c++
 
 
 
import java.util.Timer;
 
import java.util.TimerTask;
 
import java.awt.*;
 
 
public class ToDo extends Frame {
 
  Timer timer;
 
  Panel panel;
 
 
  public ToDo ( int seconds ) 
 
  {
 
  setBounds(100,100,100,100);
 
  setVisible(true);
 
  panel= new Panel();
 
  add(panel);
 
    timer = new Timer (  ) ;
 
    timer.schedule ( new ToDoTask (  ) ,10, seconds*1000 ) ;
 
  }
 
 
 
    public void paint(Graphics g) {
 
//setColor(Color.BLACK);
 
  // g.drawText(25, 25, "asdf");
 
 
 
  }
 
 
 
  class ToDoTask extends TimerTask
 
  {
 
    public void run (  )  {
 
                          System.out.println ( "OK, It's time to do something!" );
 
                          setBounds(200,200,200,200) ;
 
                          repaint();
 
 
                          //  timer.cancel (  ) ; //Terminate the thread
 
                          }
 
  }
 
 
 
  public static void main ( String[] args )  {
 
    System.out.println ( "Schedule something to do in 5 seconds." ) ;
 
    new ToDo ( 5 ) ;
 
   
 
   
 
    System.out.println ( "Waiting." ) ;
 
  }
 
}
 

Latest revision as of 09:22, 16 September 2019