I would like to change the cursor icon to my customized 32x32 image when a Java application is executing. I looked and searched, those I found are just setting cursor on a JComponent. But I want the cursor changed to my specified icon wherever it goes moving, browsing, and click, as long as the Java application is still running, or you can say program runtime.
Thanks alot.
Try settin the cursor on the rootPane.
Standard cursor image:
User defined Image:
You can download a zip containing sample source: HERE
or you can refer to :-
http://java23s.blogspot.in/2011/07/to-change-mouse-pointer-using-java.html
Call Component.setCursor. The class Cursor as a few predefined cursors.
A custom cursor image can be created:
Why don't you have a class MyFrame which exteds JFrame. All it does is call the JFrame constructor and sets the cursor to your desired cursor. In my application we have a touch screen with no cursor so this is how I intend to implement it.