Results 1 to 2 of 2

Thread: Jave Cursor

  1. #1
    Join Date
    Jun 2014
    Posts
    1
    Rep Power
    0

    Default Jave Cursor

    I would like to declare that the question I post might be asked before, but I don't know how should I search for my question.

    I have a JLabel, when my cursor moved to the JLabel, I want it to become like this:

    Jave Cursor-1.png
    Jave Cursor-2.png


    I've tried this but the result doesn't shows what I expected:

    Java Code:
    		lblRefrenceImage.addMouseMotionListener(new MouseMotionAdapter() {
    			@Override
    			public void mouseMoved(MouseEvent arg0) {
    				setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    			}
    		});
    Helps appreciated and please lead me if there is similar post. =)

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,598
    Rep Power
    5

    Default Re: Jave Cursor

    What you want is not really a cursor but simply cross hairs within the panel. To do that you probably would have to intercept mouse events and then draw horizontal and diagonal lines. If there are other, built-in ways to achieve that then others may be able to offer more appropriate help.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. DnD and CCP from non jave apps
    By madroadbiker in forum AWT / Swing
    Replies: 8
    Last Post: 06-02-2011, 06:40 PM
  2. Jave + C#
    By Durden in forum New To Java
    Replies: 7
    Last Post: 05-04-2011, 02:58 PM
  3. Need Help For Jave Slideshow
    By defanci in forum New To Java
    Replies: 0
    Last Post: 01-06-2011, 07:15 AM
  4. change the mouse cursor - crosshair cursor
    By cassysumandak in forum New To Java
    Replies: 1
    Last Post: 09-28-2009, 01:57 AM

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
  •