Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt

Class Cursor

java.lang.Object
|
+--java.awt.Cursor

All Implemented Interfaces:

Serializable


public class Cursor

extends Object

implements Serializable

This class represents various predefined cursor types.

Author:

Field Summary

static intCROSSHAIR_CURSOR

Constant for a cross-hair cursor.
static intCUSTOM_CURSOR

static intDEFAULT_CURSOR

Constant for the system default cursor type
static intE_RESIZE_CURSOR

Cursor used over E edge of window decorations.
static intHAND_CURSOR

Constant for a hand cursor.
static intMOVE_CURSOR

Constant for a cursor used during window move operations.
static intNE_RESIZE_CURSOR

Cursor used over NE corner of window decorations.
static intNW_RESIZE_CURSOR

Cursor used over NW corner of window decorations.
static intN_RESIZE_CURSOR

Cursor used over N edge of window decorations.
static intSE_RESIZE_CURSOR

Cursor used over SE corner of window decorations.
static intSW_RESIZE_CURSOR

Cursor used over SW corner of window decorations.
static intS_RESIZE_CURSOR

Cursor used over S edge of window decorations.
static intTEXT_CURSOR

Constant for a cursor over a text field.
static intWAIT_CURSOR

Constant for a cursor to display while waiting for an action to complete.
static intW_RESIZE_CURSOR

Cursor used over W edge of window decorations.
java.lang.Stringname

static java.awt.Cursor[]predefined

Constructor Summary

Cursor(int type)

Initializes a new instance of Cursor with the specified type.
Cursor(java.lang.String name)

This constructor is used internally only.

Method Summary

static java.awt.CursorgetDefaultCursor()

Returns an instance of the system default cursor type.
java.lang.StringgetName()

static java.awt.CursorgetPredefinedCursor(int type)

Returns an instance of Cursor for one of the specified predetermined types.
static java.awt.CursorgetSystemCustomCursor(java.lang.String name)

Retrieves the system specific custom Cursor named Cursor names are, for example: "Invalid.16x16".
intgetType()

Returns the numeric type identifier for this cursor.
java.lang.StringtoString()

Field Details

CROSSHAIR_CURSOR

public static final int CROSSHAIR_CURSOR

Constant for a cross-hair cursor.


CUSTOM_CURSOR

public static final int CUSTOM_CURSOR


DEFAULT_CURSOR

public static final int DEFAULT_CURSOR

Constant for the system default cursor type


E_RESIZE_CURSOR

public static final int E_RESIZE_CURSOR

Cursor used over E edge of window decorations.


HAND_CURSOR

public static final int HAND_CURSOR

Constant for a hand cursor.


MOVE_CURSOR

public static final int MOVE_CURSOR

Constant for a cursor used during window move operations.


NE_RESIZE_CURSOR

public static final int NE_RESIZE_CURSOR

Cursor used over NE corner of window decorations.


NW_RESIZE_CURSOR

public static final int NW_RESIZE_CURSOR

Cursor used over NW corner of window decorations.


N_RESIZE_CURSOR

public static final int N_RESIZE_CURSOR

Cursor used over N edge of window decorations.


SE_RESIZE_CURSOR

public static final int SE_RESIZE_CURSOR

Cursor used over SE corner of window decorations.


SW_RESIZE_CURSOR

public static final int SW_RESIZE_CURSOR

Cursor used over SW corner of window decorations.


S_RESIZE_CURSOR

public static final int S_RESIZE_CURSOR

Cursor used over S edge of window decorations.


TEXT_CURSOR

public static final int TEXT_CURSOR

Constant for a cursor over a text field.


WAIT_CURSOR

public static final int WAIT_CURSOR

Constant for a cursor to display while waiting for an action to complete.


W_RESIZE_CURSOR

public static final int W_RESIZE_CURSOR

Cursor used over W edge of window decorations.


name

protected String name


predefined

protected static Cursor[] predefined


Constructor Details

Cursor

public Cursor(int type)

Initializes a new instance of Cursor with the specified type.

Parameters:

Throws:


Cursor

protected Cursor(java.lang.String name)

This constructor is used internally only. Application code should call Toolkit.createCustomCursor().

Parameters:


Method Details

getDefaultCursor

public static Cursor getDefaultCursor()

Returns an instance of the system default cursor type.

Returns:


getName

public String getName()


getPredefinedCursor

public static Cursor getPredefinedCursor(int type)

Returns an instance of Cursor for one of the specified predetermined types.

Parameters:

Returns:

Throws:


getSystemCustomCursor

public static Cursor getSystemCustomCursor(java.lang.String name)

Retrieves the system specific custom Cursor named Cursor names are, for example: "Invalid.16x16".

Parameters:

Throws:


getType

public int getType()

Returns the numeric type identifier for this cursor.

Returns:


toString

public String toString()