/* * SnowApplet.java * * This Applet was created under NetBeans 3.6.1 and does not use packages. * * Created on June 25, 2004, 4:44 PM */ /** * * @author levenick */ import java.awt.*; public class SnowApplet extends java.applet.Applet { SnowPerson aSnowPerson = new SnowPerson(100,200,50); SnowPerson bSnowPerson = new SnowPerson(300,400,80); SnowPerson cSnowPerson = new SnowPerson(230,250,20); /** Initializes the applet SnowApplet */ public void init() { initComponents(); setSize(600,600); } public void paint(Graphics g) { g.setColor(new Color(200,200,200)); g.fillRect(0,0,600,600); aSnowPerson.paint(g); bSnowPerson.paint(g); cSnowPerson.paint(g); } /** This method is called from within the init() method to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() {//GEN-BEGIN:initComponents meltButton = new java.awt.Button(); setLayout(null); meltButton.setLabel("warm day"); meltButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { meltButtonActionPerformed(evt); } }); add(meltButton); meltButton.setBounds(0, 0, 130, 24); }//GEN-END:initComponents private void meltButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_meltButtonActionPerformed aSnowPerson.melt(); bSnowPerson.melt(); cSnowPerson.melt(); repaint(); }//GEN-LAST:event_meltButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private java.awt.Button meltButton; // End of variables declaration//GEN-END:variables }