java.awt

Class Cursor

public class Cursor extends Object implements Serializable

This class represents various predefined cursor types.
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.
protected Stringname
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.
protected static Cursor[]predefined
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.
Constructor Summary
Cursor(int type)
Initializes a new instance of Cursor with the specified type.
protected Cursor(String name)
This constructor is used internally only.
Method Summary
static CursorgetDefaultCursor()
Returns an instance of the system default cursor type.
StringgetName()
static CursorgetPredefinedCursor(int type)
Returns an instance of Cursor for one of the specified predetermined types.
static CursorgetSystemCustomCursor(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.
StringtoString()

Field Detail

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.

name

protected String name

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.

predefined

protected static Cursor[] predefined

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.

Constructor Detail

Cursor

public Cursor(int type)
Initializes a new instance of Cursor with the specified type.

Parameters: type The cursor type.

Throws: IllegalArgumentException If the specified cursor type is invalid

Cursor

protected Cursor(String name)
This constructor is used internally only. Application code should call Toolkit.createCustomCursor().

Method Detail

getDefaultCursor

public static Cursor getDefaultCursor()
Returns an instance of the system default cursor type.

Returns: The system default cursor.

getName

public String getName()

getPredefinedCursor

public static Cursor getPredefinedCursor(int type)
Returns an instance of Cursor for one of the specified predetermined types.

Parameters: type The type contant from this class.

Returns: The requested predefined cursor.

Throws: IllegalArgumentException If the constant is not one of the predefined cursor type constants from this class.

getSystemCustomCursor

public static Cursor getSystemCustomCursor(String name)
Retrieves the system specific custom Cursor named Cursor names are, for example: "Invalid.16x16".

Throws: AWTException HeadlessException If GraphicsEnvironment.isHeadless() returns true.

getType

public int getType()
Returns the numeric type identifier for this cursor.

Returns: The cursor id.

toString

public String toString()