KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > common > RolloverButton


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.admin.common;
5
6 import java.awt.event.MouseAdapter JavaDoc;
7 import java.awt.event.MouseEvent JavaDoc;
8
9 /**
10  * A Button that paints its border when the mouse flies over.
11  */

12
13 public class RolloverButton extends XButton {
14   public RolloverButton() {
15     super();
16     setBorderPainted(false);
17     addMouseListener(new FlyoverListener());
18   }
19   
20   class FlyoverListener extends MouseAdapter JavaDoc {
21     public void mouseEntered(MouseEvent JavaDoc me) {
22       setBorderPainted(true);
23     }
24     public void mouseExited(MouseEvent JavaDoc me) {
25       setBorderPainted(false);
26     }
27   }
28 }
29
Popular Tags