User Tools

Site Tools


resources_for_peek-a-boo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
resources_for_peek-a-boo [2022/05/09 12:53] – created frchrisresources_for_peek-a-boo [2022/05/23 16:43] (current) frchris
Line 1: Line 1:
 **Peek-A-Boo** **Peek-A-Boo**
  
-<code>+<code java>
 import java.awt.Color; import java.awt.Color;
 import java.awt.Font; import java.awt.Font;
Line 15: Line 15:
 public class PeekABoo extends JPanel implements KeyListener, ActionListener public class PeekABoo extends JPanel implements KeyListener, ActionListener
 { {
- public static int WIDTH=800;+ public static int WIDTH=1200;
  public static int HEIGHT=600;  public static int HEIGHT=600;
  private Font titleFont, bigFont;  private Font titleFont, bigFont;
Line 82: Line 82:
  int r = (int)(26*Math.random());  int r = (int)(26*Math.random());
  ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r);  ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r);
- message = "try Again.  The new Letter is "+ch;+ message = "No, try Again.  The new Letter is "+ch
 + timer1.restart();
  }  }
  repaint();  repaint();
Line 94: Line 95:
  if (e.getSource()==timer1){  if (e.getSource()==timer1){
  message = "Now type that Letter";  message = "Now type that Letter";
 + timer1.stop();
  timer2.start();  timer2.start();
  } else {  } else {
 + timer2.stop();
  int r = (int)(26*Math.random());  int r = (int)(26*Math.random());
  ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r);  ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r);
  message = "try Again.  The new Letter is "+ch;  message = "try Again.  The new Letter is "+ch;
 + timer1.restart();;
  }  }
  repaint();  repaint();
resources_for_peek-a-boo.1652115199.txt.gz · Last modified: 2022/05/09 12:53 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki