Specifications
Sun Services
Java™ Programming Language
Module 11, slide 15 of 22
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Complex Example
26
27 // These are MouseMotionListener events
28 public void mouseDragged(MouseEvent e) {
29 String s = "Mouse dragging: X = " + e.getX()
30 + " Y = " + e.getY();
31 tf.setText(s);
32 }
33
34 public void mouseEntered(MouseEvent e) {
35 String s = "The mouse entered";
36 tf.setText(s);
37 }
38
39 public void mouseExited(MouseEvent e) {
40 String s = "The mouse has left the building";
41 tf.setText(s);
42 }










