Cursor: getPredefinedCursor(int type) : Cursor « java.awt « Java by API






Cursor: getPredefinedCursor(int type)

  
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Toolkit;

import javax.swing.JFrame;

public class MainClass {

  public static void main(String[] args) {
    JFrame aWindow = new JFrame();
    aWindow.setBounds(200, 200, 200, 200);
    aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    aWindow.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    aWindow.getContentPane().setBackground(Color.PINK);
    aWindow.setVisible(true);
  }
}
           
         
    
  








Related examples in the same category

1.Cursor.CROSSHAIR_CURSOR
2.Cursor.DEFAULT_CURSOR
3.Cursor.HAND_CURSOR
4.Cursor.MOVE_CURSOR
5.Cursor.NE_RESIZE_CURSOR