So my issue is that on Saturday I made a custom frame in Java and I made it so the user can move the frame. I got that working. Now my question is that I have a label which gives my users the ability to move the frame around and I was wondering how would I make it so when the users is clicking or the mouse is in the label, it shows a Cursor that I have made. I was just wondering what code would I use for this.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
In your MouseListener you can use:
Read the Cursor API for more information. You can use the getPredefinedCursor() method.
The mousePressed() method would set the cursor. Then in the mouseReleased() method you would set the cursor to null to restore the default cursor.
Edit:
To use a custom cursor the basic code would be:
and you provide the image to use for the Cursor.