Example #1
0
 public void actionPerformed(ActionEvent e) {
   if (e.getSource() == b1) {
     System.out.println("You Clicked Click me");
     System.out.println("And the textarea has: " + text.getText());
     x = x + 10;
     y = y + 10;
     canvas.update(canvas.getGraphics());
   } else if (e.getSource() == labeler) {
     label.setText(text.getText());
     // pane.add(new JLabel(text.getText()));
     text.setText("");
   } else if (e.getSource() == b2) {
     System.out.println("Shutting down");
     System.exit(0);
   }
 }