Change cursor to image

How do I change the look of the cursor to a specific image?
I want to click on my image and that the cursor change to that image until I click the mouse again.
Shall I use a JButton, JLabel or just drawImage under my Image?

    public static Cursor getDefaultCursor()
        Cursor defaultCursor = null;
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        URL cursorUrl = ChangingCursorExample.class.getResource("Cursor.gif");
        Image cursorImage = new ImageIcon(cursorUrl).getImage();
        defaultCursor = toolkit.createCustomCursor(cursorImage, new Point(1, 1),"AA_Cursor");
        return defaultCursor;
    }    And then call setCursor(getDefaultCursor()) on your frame.

Similar Messages

  • How do I change cursor to hand pointer when hovering over image?

    Title says it all.
    I'm trying to get the hand cursor when user hovers over an image that's a link.
    Thanks!

    hi.......
    if u want to change the cursor on Image than two property u have to change <......buttonMode="true" useHandCursor="true".....> OR  if u want to change the cursor on label than u have to change <......buttonMode="true" useHandCursor="true" mouseChildren="false".....>
    OR  u can set the mouseOVER event and handler in that u can change the cursor of that ..
    U have two options if u want to keep seprate code then 2nd one is good for u......I hope it will help u ......

  • CSS code to change cursor to magnify symbol on hover over specific images

    Hi to you experts out there!  I'm having a problem getting my CSS code to work.  (I'm using Adobe CS4 Design Premium)
    The web pages I'm working on are a gallery of images, with linked thumb images to the left which when clicked show the complete image on the right of the page.  All 'main images' can also be clicked on to link to the next main image along, corresponding to the order of the thumbs. However, some 'main images' when clicked on are linked to larger, full page versions of an image.  In this instance I want the user to see the pointer/cursor to change from the little hand to a magnify symbol when hovering over these specific main images. This is where I can't get the css code to work/achieve this.
    For your info the main images reside in '#main_image' div.  There is a compound CSS Rule for the main image pic called 'main_image a img', for a 2px, white border.  There is then a hover state for this 'main_image a img:hover' where the border changes colour. (the main pic is assigned the ID 'img')
    I have created a new compound CSS Rule for specific main images, where I want the cursor to change to a magnify symbol, again corresponding to the '#main_image' div, named 'main_image a zoomin' and also a hover state, 'main_image a zoomin:hover'.  These two still have the same border attributes as above, 'a img' and 'a img:hover' (these main pics have been assigned the ID 'zoomin').  However, this is where I have also added CSS code for the cursor change.  I have tried 15 or so variations of the following, without success:
    #main_image a zoomin {
         cursor: url ('images/magnify.cur'), pointer;
         [then the border attributes...]
    and...
    #main_image a zoomin {
         cursor: url ('images/magnify.cur'), -moz-zoom-in, auto;
         [then the border attributes...]
    What am I doing wrong?  This can't be difficult!  Would welcome some help please!
    (Within the root directory: WinVista(C)/local_sites/sjcillustration/images' there are two files 'magnify.cur' (a downloaded img) and 'magnify.png' (my custom img - created in Illustrator, which I would actually prefer to use, but can't export as a .cur file). )

    Call me Capt. Obvious, but why can't you put a "magnify" icon next to or below the thumbnail image along with the words "Click to Zoom?"
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Change richtexteditor backgound-image

    Hi experts. I'm using jDeveloper 11.1.1.6.0.
    I have 2 richtexteditor in my jspx. The first rte must show img1.jpg (like watermark) in your panel editor (panel blank for edition on richinputtext) and the second rte must show img2.jpg.
    I want to change backgoung-image of the panel editor (panel blank on richinputtext) only, NOT backgoung-image of the entire richinputtext component.
    Can I do that?

        public static Cursor getDefaultCursor()
            Cursor defaultCursor = null;
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            URL cursorUrl = ChangingCursorExample.class.getResource("Cursor.gif");
            Image cursorImage = new ImageIcon(cursorUrl).getImage();
            defaultCursor = toolkit.createCustomCursor(cursorImage, new Point(1, 1),"AA_Cursor");
            return defaultCursor;
        }    And then call setCursor(getDefaultCursor()) on your frame.

  • I have just downloaded Mac OS X 10.9 and Pages 5. When I open any pre-existing document in the new Pages the format is zoomed to 125%, the headers are out of position, the margins are changes, and inserted images are also relocated. What can I do?

    I have just downloaded Mac OS X 10.9 and Pages 5. When I open any pre-existing document in the new Pages the format is zoomed to 125%, the headers are out of position, the margins are changes, and inserted images are also relocated. What can I do?

    Have you tried resetting the SMC ?     >  Resetting the System Management Controller (SMC)

  • How do I change the JPEG image size in PSE-12 when opening from RAW

    Switching from PSE-9 to PSE-12. When a JPEG image is opened RAW in PSE-12 the size is 18.72" Wide x 12.48" high 300 DPI. The same image in PSE-9 is 23.4" wide x 15.6" High 240 DPI. How do I get PSE-12 to open the image as in PSE-9?

    Uncheck the boxes at the bottom of the dialog Scale styles and resample Image so that only constrain proportions is checked. If you the change the resolution box from 240 to 300 you will get back to your original dimensions.
    This is a meaningless thing to do, you still have the exact same number of pixels, you have only changed the metadata number in the file for ppi, and your prints are not affected by this number.
    You could also use the same method to change the dimensions to 6 x 4 or 9 x 6 etc.
    There are some cases (actually most cases) where you need to CROP the photo to change the dimensions, when the aspect ratio of the original photos is different than the aspect ratio of the final photo; the specific case in 99jon's example is the only case you ever want to change dimensions using Image->Resize->Image Size, where the aspect ratio doesn't change from 6x4 to 9x6 (or 12x8 or 18x12 or ...), and even then, you could do the same thing simply by telling the printer the size you want, you don't really need to do anything in PSE.

  • Changing resolution and image size doesn't change result on screen?

    I'm using Photoshop CS3. I am trying to change the resolution of several images that will be printed in a newspaper. So the current images are 72 ppi and really huge -- for example 36 x 27 inches (document size), and when I change them to 300 ppi, the image sizes shrink to about 8 x 6 inches, as I expect. But the image I see on the screen doesn't change. So, for example, when I open up the image originally, it's at 33% and the entire image is visible. After I change the resolution, and the image size has changed accordingly, the image still appears the same and it remains at 33%. Shouldn't the image shrink on the screen since its size has shrunk? Or if it remains the same on the screen, shouldn't the percentage shift? I mean if the document size is now 8 x 6, it should be able to be displayed at 100% and not fill my whole screen... I'm so confused. Thanks...

    gradded,
    The "Document Size" area of the Image Size dialog is just to indicate the size (in inches) that your document will be printed. The ppi adjustment has nothing to do with what is displayed on your monitor. Your monitor doesn't care anything about ppi. The monitor contains a certain number of pixels and after you change that ppi setting, the monitor will still have that same number of pixels.
    As long as you leave the "Resample Image" box unchecked, your image size (Pixel Dimensions) will not change. You will see no change on your monitor. If you check the "Resample Image" box, then your image size (in pixels) will change.
    Hope this helps.

  • How do you change the default image at the login screen??

    I want to change my default image that is at the login screen. The image is also in the desktop display(so i can set it as my background), but those are the only two places I can find it. Is there a way I can delete the image from my computer?

    Well quick and dirty is to replace the applelogo.tif file with a .tif of your own.
    Read this site for cool ways to hack your login window:
    http://tinyurl.com/reanz
    Richard

  • Best way to allow user to change text and image

    Hi,
    A friend wants to change his product images and pricing etc.,
    on his static web pages.
    At the moment each product is within a cell in a table and
    the cell below is where the text for details and pricing is. This
    is the only area he will need to be in. Each product and edtails in
    each cell of a table on each page.
    He does not know anything about web design, Dreamweaver etc.,
    but wants to do update himself.
    I would like to know the best way for me to go about this
    using DW CS3. Maybe there is another script or program that will
    allow this.
    Thanks
    oz

    ozstar wrote:
    > Hi,
    >
    > A friend wants to change his product images and pricing
    etc., on his static
    > web pages.
    >
    > At the moment each product is within a cell in a table
    and the cell below is
    > where the text for details and pricing is. This is the
    only area he will need
    > to be in. Each product and edtails in each cell of a
    table on each page.
    >
    > He does not know anything about web design, Dreamweaver
    etc., but wants to do
    > update himself.
    >
    > I would like to know the best way for me to go about
    this using DW CS3. Maybe
    > there is another script or program that will allow this.
    >
    > Thanks
    >
    >
    > oz
    >
    Hi,
    You could use....
    An easy CMS like -
    http://www.cushycms.com/
    Contentseed -
    http://contentseed.com/
    Contribute -
    http://www.adobe.com/products/contribute/
    HTH
    chin chin
    Sinclair

  • I did a presentation with many images and animations, now I need to change only the images without modify the related animations. How can I do it?

    I did a presentation with many images and animations, now I need to change only the images without modify the related animations. How can I do it?
    I use Keynote 09

    Select the image you want to change and go to Format Menu>Advanced>Define as Media Placeholder (or command, option, control i).

  • When I make a change to an image in Develop, how do i retain it?

    When I make a change to an image in Develop then go back to Library, I loose the change.  How do I retain the change?

    You don't have to do anything special. The changes made in Develop do stick.
    Perhaps the change isn't being shown in the Library module. There's a minor bug that shows up occasionally. When you're looking at the preview in the Library module, hit the spacebar to go to 1:1 and then hit it again to go back to Fit. That should update the preview to match what you did in Develop.
    Hal

  • I have a 13" macbook from 2009 and for some reason can no longer change my desktop image by just clicking on an image in system prererences I-Photo. Does anyone know what the problem could be?

    I have a 13" macbook from 2009 and for some reason can no longer change my desktop image by just clicking on an image in system prererences>I-Photo. Does anyone know what the problem could be?

    Your Desktop Picture settings and Dock items are stored in the files
    /Users/your short user name/Library/Preferences/com.apple.desktop.plist and
    /Users/your short user name/Library/Preferences/com.apple.dock.plist
    in the "Preferences" folder in your user library. This looks like the system has trouble to write to these files. Check the permissions on your user library and remove the above files from your user library, then log off and on again.
    Your user library is hidden in Lion and Mt. Lion. To reveal it, use the Finder's "Go" menu. Select "Go" in the Finder's main menu bar and hold down the alt/option key, until you see the "Library"  in the drop-down menu. Double click it to open a Finder window, so you can browse the files inside.
    Regards
    Léonie

  • Create one button to change the background image

    Hello,
    can anyone help me create a button for a SPA525g phone which changes the background image of the phone which is now :
    <BMP_Picture_Download_URL group="User/Screen">http://192.168.2.2:5000/provisioning/logo/cisco525g.jpg</BMP_Picture_Download_URL>
    The button should also call to *1232
    So with button IN the image should change to ciscoOUT.jpg and call to *1232
    And button OUT should change the image to ciscoIN.jpg and call to *1231
    I now have already
    <PSK_1 group="Phone/Programmable_Softkeys">fnc=sd;ext=*[email protected];vid=20;nme=IN</PSK_1>
    I also tried to do :
    <PSK_3 group="Phone/Programmable_Softkeys">fnc=xml;url=http://192.168.2.2:5000/provisioning/logo/cisco_logo.xml;nme=scrp1</PSK_3>
    where cisco_logo.xml contains :
    <?xml version="1.0" encoding="utf-8"?>
    <CiscoIPPhoneImageFile>
      <Title>Image1</Title>
      <Prompt>Prompt1</Prompt>
      <LocationX>0</LocationX>
      <LocationY>0</LocationY>
      <URL>http://192.168.2.2:5000/provisioning/logo/cisco50xg.bmp</URL>
    </CiscoIPPhoneImageFile>
    but then nothing happens ? I can see the image and choose update , but that is it.
    Plus I want to combine the two option.

    anyone who can help me out here ??

  • Applying changes to multiple images . . .

    i'm relatively new to macs but i've been using aperture comfortably for the past few months.
    having just returned from a long photography trip and upgrading aperture to 1.5.1, i'm finding that i am unable to apply changes to multiple images like i used to, such as: selecting multiple images to rotate or selecting multiple images to apply the "stamp."
    when i try to "shift-select" multiple images, the change i'm trying to apply affects only the last image clicked-on in the "shift-select" grouping. does that make sense?
    has anyone else encountered this?
    mahalo nui loa
    Power Mac G5 Quad   Mac OS X (10.4.8)  

    You most likely have the Primary Only option turned on. Turn off that option in the Control Bar.

  • Changing color of Image in PSE 8.0

    I have a logo design that is black on white.  I'd like to change the black to another color - in this case, blue.  I wqas able to do it, but it ended up being quite convoluted.  What are some simple ways to change the color of a selected area in Elements 8.  I'm using a PC, BTW.
    Thanks!

    Thank you.  I found another way that's even simpler.  I chose the paint brush, set the mode to lighten, and then just painted over the image with blue - the white didn't pick up any of the blue, but the black did.
    Date: Tue, 22 Feb 2011 17:02:09 -0700
    From: [email protected]
    To: [email protected]
    Subject: Changing color of Image in PSE 8.0
    1. Select the black (use the magic wand if it's all one color).
    2. Layer>New Adjustment Layer>Hue Saturation.
    3. Turn on the colorize checkbox in the layers panel, and move the sliders till you see the color you want.
    >

Maybe you are looking for

  • Dunning letters excluding credits

    Hello, I am experiencing problems with my dunning letters. When using the wizard and selecting my BP I can clearly see credit notes on the recommendations report however when I come to print the dunning letter, it is omitting it from the report. Why

  • Pop up menu

    I have a class that extends JPasswordField. no i need a thing like a pop up menu like in the windows when you have caps lock on i come up to tell you this way my users know that caps is active. i have done all of the back door stuff and at the moment

  • I am getting an "error -5000" message when I try to backup my iphone 4 to itunes.  Any ideas what this means?

    i am getting an "error -5000" message when I try to backup my iphone 4 to itunes.  Any ideas what this means?

  • InDesign CC bounding box alignment illusion

    Has anyone else experienced an illusion in InDesign CC where the top of a bounding box appears to be misaligned with a margin or guide because the standard blue bounding box is replaced with a blue + magenta margin color? I have confirmed this is jus

  • Incorrect update

    Hello Oracle 11.1.0.6.0 We have a financial app developed in house using java and tomcat. Under very high load we have noticed some anomalies. There are multiple customers and only one vendor. We see something like this Vendor balance = 0 Customer 1