I have set my label's cursor to hand cursor in the label's properties. So now I'm going to check if my label's cursor is hand cursor then I'll do something there. I've tried to use this code to check, but if keeps falls into the false part which means my label's cursor is not hand cursor. I don't understand why.
if (lblSample.getCursor().equals(new Cursor(Cursor.HAND_CURSOR))) {
System.out.println("True");
}else{
System.out.println("False");
}
Cursor does not override
equals()
, so this method is not very useful.You can check cursor type: