Cursor.HAND_CURSOR : Cursor « java.awt « Java by API






Cursor.HAND_CURSOR

  

import java.awt.Cursor;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class Main extends JFrame {
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        Main mainForm = new Main();
        mainForm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainForm.setSize(250, 250);

        Cursor cursor = new Cursor(Cursor.HAND_CURSOR);
        mainForm.setCursor(cursor);

        mainForm.pack();
        mainForm.setVisible(true);
      }
    });
  }
}

   
    
  








Related examples in the same category

1.Cursor.CROSSHAIR_CURSOR
2.Cursor.DEFAULT_CURSOR
3.Cursor.MOVE_CURSOR
4.Cursor.NE_RESIZE_CURSOR
5.Cursor: getPredefinedCursor(int type)