Java Swing Tutorial - Java Cursor TEXT_CURSOR








Syntax

Cursor.TEXT_CURSOR has the following syntax.

public static final int TEXT_CURSOR

Example

In the following code shows how to use Cursor.TEXT_CURSOR field.

import java.awt.Cursor;
//from ww w  .java2 s.c  o m
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(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
    aWindow.setVisible(true);
  }
}