package AWT;
import java.awt.Button;
import java.awt.Cursor;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class CursorTest {
Frame f=null;
public static void main(String[] args) {
new CursorTest();
}
public CursorTest()
{
f=new Frame();
f.setSize(300,150);
f.setLayout(new FlowLayout());
Button b1=new Button("Aceptar");
b1.addMouseListener(new MouseAdapter(){
public void mouseEntered(MouseEvent e){
f.setCursor(Cursor.HAND_CURSOR);
}
public void mouseExited(MouseEvent e){
f.setCursor(Cursor.DEFAULT_CURSOR);
}
});
f.add(b1);
f.setVisible(true);
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
}
No hay comentarios:
Publicar un comentario