Salve a tutti
qualcuno mi puo' dire se e' possibile modificare l'aspetto del cursore in java , esempio farlo diventare una clessidra o qualche altra figura ? Se la risposta e' si, come posso fare per cambiare l'aspetto?
Grazie a tutti
Salve a tutti
qualcuno mi puo' dire se e' possibile modificare l'aspetto del cursore in java , esempio farlo diventare una clessidra o qualche altra figura ? Se la risposta e' si, come posso fare per cambiare l'aspetto?
Grazie a tutti
si puoi usare il metodo
di java.awt.Component ereditato da JPanel:
setCursor(Cursor cursor)
per creare un cursore:
metodo statico della classe Cursor
Cursor.getPredefinedCursor(int type)
dove type è e una delle costanti della classe Cursor.
static int CROSSHAIR_CURSOR
The crosshair cursor type.
static int CUSTOM_CURSOR
The type associated with all custom cursors.
static int DEFAULT_CURSOR
The default cursor type (gets set if no cursor is defined).
static int E_RESIZE_CURSOR
The east-resize cursor type.
static int HAND_CURSOR
The hand cursor type.
static int MOVE_CURSOR
The move cursor type.
static int N_RESIZE_CURSOR
The north-resize cursor type.
protected java.lang.String name
The user-visible name of the cursor.
static int NE_RESIZE_CURSOR
The north-east-resize cursor type.
static int NW_RESIZE_CURSOR
The north-west-resize cursor type.
static int S_RESIZE_CURSOR
The south-resize cursor type.
static int SE_RESIZE_CURSOR
The south-east-resize cursor type.
static int SW_RESIZE_CURSOR
The south-west-resize cursor type.
static int TEXT_CURSOR
The text cursor type.
static int W_RESIZE_CURSOR
The west-resize cursor type.
static int WAIT_CURSOR
The wait cursor type.
puoi anche creare cursori personalizzati (guarda la classe Toolkit
di java.lang)