Java Cursor(int type) Constructor
Example
In the following code shows how to use Cursor.Cursor(int type) constructor.
//from w w w . j a va2 s .c o m
import java.awt.Cursor;
import javax.swing.JFrame;
public class Main {
public static void main(String[] args) {
JFrame aWindow = new JFrame();
aWindow.setBounds(200, 200, 200, 200);
aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
aWindow.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
aWindow.setVisible(true);
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »