How do I make my own cursor?

How would I make my cursor invisible using java?

  • I'm trying to make a JApplet, but I'm having difficulty making the cursor invisible. Does anyone know how to make the cursor invisible?

  • Answer:

    This should help: there's a setCursor() method written into Java. from within the applet you can use the MouseMotionListener as suggested before to check and see if it's in the specified area and if so just call this.setCursor( new Cursor( some_empty_icon ) ); and you have what you need. Here's some code where I did something similar, looking for hot spots on an applet: public void mouseMoved( MouseEvent e ){ if( board.changeCursor( e.getX(), e.getY() ) this.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); else this.setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) ); } where board.changeCursor just checked to see whether the mouse was moved to a hot spot or not. hope this helps. If you want to check and see what Cursors are available check out the API. -Joe (Copied from link below)

Notte at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.