home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / Bluette / Examples / Love.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-12-05  |  3.7 KB  |  125 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Event;
  6. import java.awt.Font;
  7. import java.awt.Graphics;
  8. import java.awt.Image;
  9. import java.awt.Label;
  10. import java.awt.LayoutManager;
  11. import java.awt.Panel;
  12.  
  13. public class Love extends Applet {
  14.    final int MenuBarHeight;
  15.    public Image Image1;
  16.    public Label Label2;
  17.    public Label Label3;
  18.    public Label Label4;
  19.    public Label Label5;
  20.    public Label Label6;
  21.    public Label Label7;
  22.    public Label Label8;
  23.    public Label Label9;
  24.    public Panel Panel1;
  25.    public Panel Panel2;
  26.    public Label Label1;
  27.  
  28.    public void init() {
  29.       ((Component)this).setForeground(Color.black);
  30.       ((Component)this).setBackground(Color.white);
  31.       ((Component)this).setFont(new Font("Dialog", 1, 12));
  32.       ((Container)this).setLayout((LayoutManager)null);
  33.       this.Image1 = ((Applet)this).getImage(((Applet)this).getCodeBase(), "oneeye.gif");
  34.       this.Label2 = new Label("Could live I like one-eyed fish", 0);
  35.       this.Label2.setFont(new Font("Helvetica", 0, 12));
  36.       this.Label3 = new Label("Could love I like one-eyed fish", 0);
  37.       this.Label3.setFont(new Font("Helvetica", 0, 12));
  38.       this.Label4 = new Label("Like the µ»öτ¢« lived swimming together", 0);
  39.       this.Label4.setFont(new Font("Helvetica", 0, 12));
  40.       this.Label5 = new Label(" till they died to live like other two-eyed fish", 0);
  41.       this.Label5.setFont(new Font("Helvetica", 0, 12));
  42.       this.Label6 = new Label("Could love I ", 0);
  43.       this.Label6.setFont(new Font("Helvetica", 0, 12));
  44.       this.Label7 = new Label("like one-eyed µ»öτ¢« ", 0);
  45.       this.Label7.setFont(new Font("Helvetica", 0, 12));
  46.       this.Label8 = new Label(". . .", 0);
  47.       this.Label8.setFont(new Font("Helvetica", 1, 11));
  48.       this.Label9 = new Label("- from <One-eyed fish's love> -", 0);
  49.       this.Label9.setFont(new Font("Helvetica", 0, 11));
  50.       this.Panel1 = new Panel();
  51.       this.Panel1.setLayout((LayoutManager)null);
  52.       this.Panel1.setForeground(Color.black);
  53.       this.Panel1.setBackground(Color.yellow);
  54.       this.Panel1.setFont(new Font("Dialog", 1, 12));
  55.       this.Panel2 = new Panel();
  56.       this.Panel2.setLayout((LayoutManager)null);
  57.       this.Panel2.setForeground(Color.black);
  58.       this.Panel2.setBackground(Color.red);
  59.       this.Panel2.setFont(new Font("Dialog", 1, 12));
  60.       this.Label1 = new Label("One-eyed fish's love", 0);
  61.       this.Label1.setFont(new Font("Helvetica", 1, 12));
  62.       this.Panel2.add(this.Label1);
  63.       this.Panel1.add(this.Panel2);
  64.       ((Container)this).add(this.Panel1);
  65.       ((Container)this).add(this.Label9);
  66.       ((Container)this).add(this.Label8);
  67.       ((Container)this).add(this.Label7);
  68.       ((Container)this).add(this.Label6);
  69.       ((Container)this).add(this.Label5);
  70.       ((Container)this).add(this.Label4);
  71.       ((Container)this).add(this.Label3);
  72.       ((Container)this).add(this.Label2);
  73.       this.InitialPositionSet();
  74.    }
  75.  
  76.    public void start() {
  77.    }
  78.  
  79.    public void stop() {
  80.    }
  81.  
  82.    public void destroy() {
  83.    }
  84.  
  85.    public void paint(Graphics var1) {
  86.       var1.drawImage(this.Image1, 272, 11, 113, 57, this);
  87.    }
  88.  
  89.    public void InitialPositionSet() {
  90.       ((Applet)this).resize(393, 245);
  91.       this.Label2.reshape(20, 55, 211, 16);
  92.       this.Label3.reshape(20, 75, 229, 16);
  93.       this.Label4.reshape(20, 95, 276, 16);
  94.       this.Label5.reshape(20, 115, 299, 16);
  95.       this.Label6.reshape(20, 135, 88, 16);
  96.       this.Label7.reshape(20, 156, 138, 16);
  97.       this.Label8.reshape(21, 179, 35, 16);
  98.       this.Label9.reshape(24, 218, 216, 18);
  99.       this.Panel1.reshape(10, 13, 252, 34);
  100.       this.Panel2.reshape(3, 3, 220, 24);
  101.       this.Label1.reshape(4, 3, 180, 18);
  102.    }
  103.  
  104.    public boolean handleEvent(Event var1) {
  105.       if (var1.id == 201 && var1.target == this) {
  106.          this.Love_WindowDestroy(var1.target);
  107.       } else if (var1.id == 503 && var1.target == this) {
  108.          this.Love_MouseMove(var1.target, var1.x, var1.y, var1.modifiers);
  109.       }
  110.  
  111.       return super.handleEvent(var1);
  112.    }
  113.  
  114.    public void Love_WindowDestroy(Object var1) {
  115.       System.exit(0);
  116.    }
  117.  
  118.    public void Love_MouseMove(Object var1, int var2, int var3, int var4) {
  119.       this.Panel1.setBackground(new Color(255, var2, var3));
  120.       this.Panel2.setBackground(new Color(255, var3, var2));
  121.       this.Panel1.repaint();
  122.       this.Panel2.repaint();
  123.    }
  124. }
  125.