Advertisement
kthomer

StopApplets.java

Nov 30th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1. /**
  2.  * @author defron
  3.  *
  4.  */
  5.  
  6. //java applet library
  7. import java.applet.*;
  8.  
  9. //screen painter
  10. import java.awt.*;
  11.  
  12.  
  13. //main class for the web applet
  14. public class StopApplets extends Applet
  15. {
  16.  
  17.     /**
  18.      *
  19.      */
  20.     private static final long serialVersionUID = 1L;
  21.  
  22.     //auto-called method for applet to start
  23.     public void init()
  24.     {
  25.         resize(270,140);
  26.     }
  27.    
  28.     /*
  29.      * method called for applet termination such as when browser is closed or page is left
  30.      */
  31.     public void stop()
  32.     {
  33.         //no code needed, empty class necessary for applet functionality
  34.     }
  35.    
  36.     /*
  37.      * Paint public method for painting to the screen
  38.      */
  39.     public void paint(Graphics g)
  40.     {
  41.         g.drawString("What!!? Are you crazy?",60,20);
  42.         g.drawString("", 20, 40);
  43.         g.drawString("Java is one of the leading causes of",20,60);
  44.         g.drawString("infections on the Internet!!!!", 40, 80);
  45.         g.drawString("", 20, 100);
  46.         g.drawString("You should only allow it on sites you", 20, 120);
  47.         g.drawString("absolutely need it on.", 60, 140);
  48.     }
  49.  
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement