How do I get an image to follow the cursor on an applet?

I'm trying to create a applet which has a bullseye on it and when the cursor moves across it the image(bullseye) follows it but I have no idea how to do this. I know I have to use the mouseMoved event. Also how do I have a JPanel covered by a image? Please help.

Actually, have a look at the Toolkit.createCustomCursor() method. It'll do it for you. I got it to work using:
Image image;
try {
    image = Toolkit.getDefaultToolkit().createImage("cursor.gif");
    Cursor c = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(0,0), "my cursor");
    setCursor(c);
catch (Exception e) {
    e.printStackTrace();
    return;
}

Similar Messages

  • How do i get my image to fill the whole page in pages

    I am making an epub book and would like the image on my cover page to fill the whol page without the large white borders around it. How can I do that in pages. I know you can't export a document as an epub if it has floating objects in it but i don;t know if thats a problem for this application or not. Thanks

    Menu > File > Page Setup > create a custom paper size of 9" x 13.5" > set all margins to 0 > Format > Any Printer > OK
    Create your custom cover as a jpeg and crop to 9" x 13.5" or proportional pixel equivalent.
    Import your cover onto the first page of your ebook.
    Inspector > Wrap > Object Placement > Inline...
    Stretch cover image to fill the page.
    Menu > File > Export > ePub > Use first page as book cover image
    Haven't tried this myself, but this is what is recommended.
    Peter

  • How can I get an image to stretch the length of my Website when being viewed on larger screens?

    Heres an example of my site im working on HERE I would like for the image on the landing page to stretch from edge to edge as needed when being viewed on larger screens. I know it's possible because it's done here I just don't know how to do it PLEASE HELP.

    To achieve a similar effect, simply use the Rectangle tool to create a horizontal bar that snaps-to-fit the browser area in Design mode. Then use the Fill options to insert an image within the rectangle; you may also want to change the Fitting option to Scale to Fill or Tile/Tile Horizontally. Refer to the following screenshot.
    Thanks,
    Vinayak

  • Also how can you get an image preview in the video section

    The music videos you buy in iTunes come with a preview that is displayed. I tried capturing an image with VLC, then converting it to a JPEG. But the when I "get info" and try and drop or paste the image it won't allow me. Any Tips?

    The music videos you buy in iTunes come with a
    preview that is displayed. I tried capturing an
    image with VLC, then converting it to a JPEG. But
    the when I "get info" and try and drop or paste the
    image it won't allow me. Any Tips?
    To set "poster frame"
    -Play video in iTunes
    -Click on video so it brings up a 2nd window (its own window)
    -Locate the "frozen picture" by pausing. You can manually shift through the whole video by using slider.
    -When you have your picture, right click, and choose "set poster frame".

  • How do you remove those yellow tags following the cursor all the time?

    You know those yellow tags with information about the words your cursor is on.
    Some times they cover the things you are reading and get really annoying.
    Any input?

    I thought there was something to remove all filters right?
    Not unless you applied the Filters as Smart Filters or duplicated the Layer prior to Filtering.
    That’s why working non-destructively is so highly advised.
    What kind and number of Filters are you talking about anyway?
    Could you post a full-res segment of the image?

  • Getting immediate character behind to the cursor in JTextPane?

    when i use left arrow, i am not getting the immediate character behind to the cursor, but i am getting the character after 2 position in JTextPane. It works fine for the right arrow. since we get the character based on the caretposition. how can i get immediate character behind to the cursor when i use other arrow's other than right arrow?
    thnx in advance

    Swing related questions should be posted in the Swing fourm.
    The simple answer would be to use getCaretPosition -1. But this is probably not what you are looking for and you question is not very detailed.
    So, posting a simple 10 line executable demo program would be nice. Its probably a problem with the order of events.

  • Pages for ipad2 - how do you get text to wrap around the contours of a picture? Not the simple square wrap, but I saw text following the contours of a bike wheel at the Apple store demo

    Pages for ipad2 - how do you get text to wrap around the contours of a picture?  Not the simple square wrap, but I saw text following the contours of a picture of a bike wheel at the Apple store demo

    Sjazbec,
    Thanks for the reply.
    I did read the help and went through the tutorial - the butterfly text wrap (and the wrap around the curved contour of the bicycle wheel at the Apple store) is the reason I am asking this question.  I don't know how to use one of my own pictures and tell Pages what contour to wrap around.  Is there some additional image editing software that I need to "creatively crop" one of my own pictures, so that Pages will be able to wrap around that contour?
    Thanks / Danke!!

  • This is about iPhoto:  I need to print the FULL IMAGE as shown on the screen:  the image is SQUARE (equal on four sides).  iPhoto keeps cropping it into a rectangle - THIS IS NOT ACCEPTABLE!  How do I get what I see on the screen in print form???

    I need to print the FULL image as shown on the screen - the image is SQUARE (equal on all four sides).  iPhoto keeps cropping it into a rectangle - this is not acceptable!  How do I get what I see on the screen into print form?

    Like Terence explained:
    OT

  • How do I get my printer to match the colours of the image as I see it on screen?

    How do I get my printer to match the colours of the image as I see it on screen? My HP Office Jet Pro L7680 printer tends to print my images with a bias towards red compared to the image I am seeing on screen with Lightroom 5 using a Mac with Retina 5 screen. Would appreciate any expertise on how to calibrate the printer to the screen

    You have two options. The first method costs nothing but is not as accurate and the second means buying hardware and investing some time. The fastest way to get things closer is to download the color profile from the printer manufactures site for the printer and paper combination you are using. Install it on you Mac and relaunch LR. This is best when the paper and printer are both from the same company; in your case, HP. If the paper is not made by HP, you can often find profiles for your paper/printer by going to the paper maker's web site and doing a search for the appropriate profile.
    The other alternative is to purchase a piece of hardware such as the ColorMonki which can be used to not only profile your monitor for color balance but also you printer/paper as well as your camera. When all of your devices agree on what color 118,118,118 means, you get the same color from capture to print but this is also an expensive option and there is a lot of time involved in building your own color profiles. The results however, are much more accurate.
    Once you have a color profile installed, the next step involves doing soft proofing. Once you have your image looking the way you want it to in LR, open it in the soft proof option. This will show you how your print will look using the color profile for the paper/printer you are using. During the process, you will be shown the print on your screen which may look off. Use the small triangle in the upper-right corner of the histogram to turn on the out-of-gamut warning. This will highlight any parts of your image which contain colors your printer can't handle. Use the rendering intent options to decide how you want these colors handled (relative or perceptual). Check them both and use the one you like best. You can also make additional changes at this point if required before you generate the JPG image. Make sure to save it as a max quality JPG using the sRGP profile. Once saved, you can send this image to your printer or even to a lab as the process is the same.The attached link should get you to a video showing how to use the ColorMunki hardware/software but, more importantly, shows you how to prepare an image for printing (in this case, for a lab) using soft proofing with the color profile created (or downloaded).--Great Color from Your Lab Prints – Every Time! on Vimeo

  • How can I get an image from the screen? Like screen printer in PC to pasting after in word or other program.

    How can I get an image from the screen? Like screen printer in PC to pasting after in word or other program.

    If you do Cmd+Shift+3 you'll get a full screen image saved to your desktop as a jpg file.
    Also, you can use Cmd+Shift+4 and you'll get a cursor which you click+drag to draw a box. When you release the drag the boxed in area will be saved to the Desktop as a jpg file.

  • How do I get an image next to my link on facebook or linkedin?

    How do I get an image next to my link on facebook or linkedin?
    Cheers, Joakim

    Make sure there are images on your page.

  • New "Photos" is a piece of JUNK!  How do I get my image numbers to display as imported like they used to? Can no longer make Events or view old events as before either.

    How do I get my image numbers to display as imported like they used to? Can no longer make Events or view old events as before either.
    If this is replacing Aperture and previous iPhoto it is USELESS...WAY fewer options for editing available. New "Photos" is a piece of JUNK!

    Hi.
    I have just migrated my library from Aperture to photos. All seems to have gone smoothly, except for one thing. All of my photos are 'untitled', whereas in both Aperture, and previously iPhoto, the filename was used for the title. If I hit CMD+I and get info, the title is still there as the filename, as I use the filename for all titles.
    Is there a way to batch copy all filenames as photo titles, this was done automatically in Aperture and iPhoto, as when photos were imported the filename was used automatically.
    Any help appreciated.
    Thanks.

  • If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

    If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

    If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

  • How do you get Raw images form a Canon 60D to open up on Photoshop Elements 9!

    How do you get Raw images form a Canon 60D to open up on Photoshop Elements 9! I tried downloading the Adobe Camera Raw 6.2 update and Elements is not recognizing the file to install!

    Go to Help>Updates in the editor and do it that way instead.

  • How do I get a movie clip to follow the cursor?

    Hi guys,
    What I want:
    Is a simple action where I have my company logo in the middle of the screen and it follows the cursor (not over the whole screen but within invisible borders).
    What I use:
    I have Flash Pro CS5, code is Actionscript 3.0 and my company logo has been converted to a movie clip.
    What didn't work:
    So I watched 2 different tutorials on how to do this and both didn't work.
    With the first one I used this code:
    function gradientOver(event:MouseEvent):void{
              logomc.visible=true;
              function reportStageMouse(event:MouseEvent):void{
                        var myStageX:Number=Math.round(event.stageX);
                        var myStageY:Number=Math.round(event.stageY);
                        var xTween:Tween=new Tween(logomc,"x", Strong.easeOut, logomc.x, myStageX, 1, true);
                        var yTween:Tween=new Tween(logomc,"y", Strong.easeOut, logomc.y, myStageY, 1, true);
              stage.addEventListener(MouseEvent.MOUSE_MOVE,reportStageMouse);
    function gradientOut(event:MouseEvent):void{
              logomc.visible=false;
    function gradientClick(event:MouseEvent):void{
              logomc.visible=false;
    gradient.addEventListener(MouseEvent.ROLL_OVER,gradientOver);
    gradient.addEventListener(MouseEvent.ROLL_OUT,gradientOut);
    gradient.addEventListener(MouseEvent.CLICK,gradientClick);
    And with the second one I had to make a border by drawing an oval shape, turn it into a movie clip and put my logo inside of it. Then I used this code:
    stage.addEventListener("mouseMove", arjun);
    function arjun(e:MouseEvent):void
              var var1 = mouseY - followins.y;
              var var2 = mouseX - followins.x;
              var radiusR = Math.atan2(var1,var2);
              var degreeR = radiusR / (Math.PI / 180);
              followins.rotation = degreeR;

    Thanks
    stage.addEventListener(MouseEvent.MOUSE_MOVE, hideCursor);
    function hideCursor(e:MouseEvent):void{
    logomc.startDrag(true);
    Mouse.hide(true);
    so I used this code and it didn't work. I first try'd it on the main timeline and then inside the logo's own timeline and even inside the backgrounds own timeline.
    no luck so far..

Maybe you are looking for

  • Video Recording with iPod?

    I am curious, can I use an iPod as a recording HD. I want to use a digital camera with AV to the iPod. How do you get video onto the iPod? Does anyone know if this will work? Thanks,

  • OVM 3 Generic Storage Plugin. Acess Group configuration causes server crash

    Our iSCSI management is currently entirely done manually at the servers console, because we still don't have a SAN Equallogic storage plugin. At OVM Manager interface, what we thought being just useless in our case (SAN Access Group), is the actual i

  • Oracle Workflow Internal Forced termination Error

    We will appreciate if anyone can be of assistance in helping us with a problem we are experiencing with Oracle Workflow. We have an Oracle Workflow Task which has several activities. This exact version of the Workflow works in 2 other environments, w

  • Project VBA Documentation/Reference

    Similar to docs.oracle.com for Java, is there documentation for VBA 2010? I need to look up a few methods for Project 2010 VBA.

  • Create Directory in Procedure

    Hi Guys, Any one please help i am getting an error during creating directory in procedure. Below is the code and error I am using windows XP, oracle 10g, sql developer and sql plus. code: - create or replace procedure checking as filing UTL_File.File