/* * LoopyApplet.java * * Created on October 1, 2004, 1:37 PM */ /** * * @author wu_staff */ public class LoopyApplet extends java.applet.Applet { /** Initializes the applet LoopyApplet */ public void init() { initComponents(); } /** 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 textArea1 = new java.awt.TextArea(); button1 = new java.awt.Button(); setLayout(null); add(textArea1); textArea1.setBounds(70, 40, 280, 160); button1.setLabel("button1"); button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { button1ActionPerformed(evt); } }); add(button1); button1.setBounds(70, 240, 220, 20); }//GEN-END:initComponents private void button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button1ActionPerformed for(int x=1; x<10; x=x+1){ textArea1.append("animal #" + x + "\n"); for(int y=x; y>0; y=y-1){ textArea1.append("\tnoise #" + y + "\n"); } } }//GEN-LAST:event_button1ActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private java.awt.Button button1; private java.awt.TextArea textArea1; // End of variables declaration//GEN-END:variables }