Results 1 to 5 of 5
  1. #1
    gaj7 is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Java cursor problem

    I am having a problem with my custom cursor in my java applet. I am making a Mini-Putt game in which the mouse is used to hit the ball. When the mouse is clicked it returns coordinates for the upper left corner but for my golf club image I want it to return coordinates for the bottom left where the bottom of the club is. How could I change my custom cursor to return bottom left coordinates?

    -Thanks, gaj7
    Last edited by gaj7; 01-12-2012 at 04:27 AM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: Java cursor problem

    How did you create the custom cursor? What parameters does that method accept?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    gaj7 is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Re: Java cursor problem

    This is the code for my cursor:

    //set Cursor
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Image cursorImage = toolkit.getImage("MiniPuttCursor.gif");
    Cursor c = toolkit.createCustomCursor(cursorImage , new Point(0,0), "img");
    this.setCursor(c);

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,967
    Rep Power
    19

    Default Re: Java cursor problem

    From the API for createCustomCursor:
    "
    hotSpot - the X and Y of the large cursor's hot spot; the hotSpot values must be less than the Dimension returned by getBestCursorSize
    "

  5. #5
    gaj7 is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

Similar Threads

  1. change the mouse cursor - crosshair cursor
    By cassysumandak in forum New To Java
    Replies: 1
    Last Post: 09-28-2009, 01:57 AM
  2. Cursor Size
    By ScottVal in forum AWT / Swing
    Replies: 1
    Last Post: 01-03-2009, 06:11 AM
  3. Cursor
    By serfster in forum New To Java
    Replies: 2
    Last Post: 06-15-2008, 05:49 AM
  4. GUI cursor change problem
    By ludragon in forum Advanced Java
    Replies: 2
    Last Post: 01-09-2008, 10:03 PM
  5. Using a cursor
    By notnumber6 in forum New To Java
    Replies: 3
    Last Post: 11-26-2007, 10:56 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •