SetCursor(Toolkit.getDefaultToolkit().createCustomCursor(new ImageIcon("mycursor1.png"). Public Cursor createCustomCursor(Image cursor,Point hotspot,String desc) throws IndexOutOfBoundsException, HeadlessException Fine, let us stop talking about this, and see the program. I asked myself how did I forget the Toolkit class that has createCustomCursor() which takes just three parameters, the Image object, hotspot point and cursor description. Using project settings is a simpler (but more limited) way to customize the mouse cursor. There are two ways to customize the mouse cursor: Using project settings. Since time, it was my tiny dream to set my own custom image cursor for a swing component and now I am able to do that in a single line! What have I done is I have been searching for a method in the Cursor class so was unable to find. Customizing the mouse cursor You might want to change the appearance of the mouse cursor in your game in order to suit the overall design.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |