/* * Applet.java * * Created on September 13, 2004, 12:55 PM */ /** * * @author wu_staff */ public class Applet extends java.applet.Applet { /** Initializes the applet Applet */ 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 button1 = new java.awt.Button(); button2 = new java.awt.Button(); textField1 = new java.awt.TextField(); textArea1 = new java.awt.TextArea(); label1 = new java.awt.Label(); setLayout(null); button1.setLabel("button1"); button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { button1ActionPerformed(evt); } }); add(button1); button1.setBounds(40, 30, 180, 24); button2.setLabel("button2"); add(button2); button2.setBounds(40, 70, 180, 24); textField1.setText("textField1"); add(textField1); textField1.setBounds(40, 140, 190, 20); textArea1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { textField1MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { rockyTheSquirrel(evt); } }); add(textArea1); textArea1.setBounds(40, 180, 310, 100); label1.setText("Balance"); add(label1); label1.setBounds(40, 120, 120, 20); }//GEN-END:initComponents private void rockyTheSquirrel(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rockyTheSquirrel textField1.setBackground(java.awt.Color.WHITE); textField1.setForeground(java.awt.Color.BLACK); }//GEN-LAST:event_rockyTheSquirrel private void textField1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_textField1MouseEntered textField1.setBackground(java.awt.Color.BLACK); textField1.setForeground(java.awt.Color.WHITE); }//GEN-LAST:event_textField1MouseEntered private void button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_button1ActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private java.awt.Button button1; private java.awt.Button button2; private java.awt.Label label1; private java.awt.TextArea textArea1; private java.awt.TextField textField1; // End of variables declaration//GEN-END:variables }