Moving Images with the mouse

Sorry I am still fairly new to Java. I have a project due that will require me to move images with the mouse. And I was wondering if someone could give me the basics of doing this. Right now I only need to know how to move the image any where on the screen.

sweety_baby wrote:
It's not so usefull nebody plzz help me i wanna code for movinag an image from one place to another in frame
plzzzzzzzz help me out its urgentIf it's so d�mn urgent, then why
1) dredge up a thread that's more than 2 years old, and
2) provide us with hardly any information about your problem, what you've done, what's worked, what's failed.
Result: request denied.

Similar Messages

  • Moving image with the mouse?

    I have several Images which I paint directly on a panel. If the mouse pointer is over an image and the user holds the mouse button pressed he shall be able to move the image.
    How would you solve that? I mean there is no contains() method in a Image class so that I would be able to check if the mouse location is over a image or not (and over which in particular).
    Any ideas?

    Then it would look like this:
         void panel_mouseDragged(MouseEvent e) {
              Contianer c = this.getParent();
              if (c instanceof JViewport) {
                   JViewport jv = (JViewport) c;
                   Point p = jv.getViewPosition();
                   int newX = p.x - (e.getX() - m_XDifference);
                   int newY = p.y - (e.getY() - m_YDifference);
                   int maxX = this.getWidth() - jv.getWidth();
                   int maxY = this.getHeight() - jv.getHeight();
                   if (newX < 0)
                        newX = 0;
                   if (newX > maxX)
                        newX = maxX;
                   if (newY < 0)
                        newY = 0;
                   if (newY > maxY)
                        newY = maxY;
                   jv.setViewPosition(new Point(newX, newY));
         void panel_mousePressed(MouseEvent e) {
              setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
              m_XDifference = e.getX();
              m_YDifference = e.getY();
         void panel_mouseReleased(MouseEvent e) {
              setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
         }Look at http://forum.java.sun.com/features.jsp#Formatting

  • Capture a part of an image with the mouse ?

    Hi,
    I am really stuck with it ! I would like to capture a part of an image with the mouse. The selection can be a rectangle or an ellipse. For a rectangle a could use PixelGrabber but for an ellipse ?
    Thanks a lot !

    thanks a lot !

  • Drawning text/images in a JPanel and then resizing/moving it with the mouse

    Hello ebverybody!
    I need to be able to draw some text objects in a JPanel and then resize/move it with the mouse... How could I do that!? Same for some images loaded from jpg files...
    Should I just paint the text and then repaint when the mouse selects it? How to do this selection?! Or should use something like a jLabel and then change it`s font metrics?!
    I need to keep track of the upper left corner of the text/image, as well as the width/height of it. This will be recorded in a file.
    The text/images need to smoothly move around the panel as the mouse drags when selectin an entity.. not just "click the entity, then click another point and the entity appears there as if by magic...":)
    Please, tell the best way to do that!
    Thanks everybody!
    Message was edited by:
    cassio.marques

    I know what you mean! This happened to me as well!
    And one thing that I found useful is, if you want to directly select a layer without selecting from the layers pallete and without having autoselect enabled, just hold Ctrl and click on in directly in the image. This saved me a lot of time!

  • Moving sliders in CS6 with the mouse wheel?

    In CS3 after clicking onto the slider "triangle" I can then adjust it with the mouse wheel.  I don't appear to be able to do this in CS6.  Can this be remedied?

    LOL!!!
    JJ got my points in another thread today, too.

  • When I select a single object in a layer and try to move it with the mouse, everything goes with...

    I've been having this problem where I can't use the move tool with the mouse properly. I'll go and select a single item on a layer and then try to move it with the mouse (move tool). I've done this before and still do it all the time on Photoshop on my other machines. However, on my laptop it won't work. I grab the single object I want to move and the second I move it, it defaults to moving every single layer in my file. The only way to get around it is to use the arrows, but that's becoming laborious and frustrating.
    Any ideas?

    I know what you mean! This happened to me as well!
    And one thing that I found useful is, if you want to directly select a layer without selecting from the layers pallete and without having autoselect enabled, just hold Ctrl and click on in directly in the image. This saved me a lot of time!

  • It is necessary to make zoom with the mouse

    When I am working, i can´t make zoom in a pdf or a picture with the mouse, I have to use comand more +. I think that is more confortable use mouse wheel.
    Sorry for my english, i am from spain and I don´t write very well in english.
    Thank you for your attention.

    Hello, Manuel91. 
    Thank you for visiting Apple Support Communities. 
    Here is an article that you may find helpful with this issue. 
    OS X Mavericks: Make the screen image larger using an Apple mouse
    http://support.apple.com/kb/PH14082
    Cheers,
    Jason H. 

  • I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image,

    I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image, the guidelines are not locked, it is annoying to have to lock them down again. and it would actually be nice, to ba able to give specific directions when placing the guidelines. Thanks

    Then why are the guides unlocked when I reopen a document that I saved with the guides locked ?
    Thanks.

  • HT1338 When I connect my Macbook Pro to my Dell DLP projector, either via cable or wirelessly, I just see a dark screen with the mouse and mouse trails only, can any one help?

    When I connect my Macbook Pro to my Dell DLP projector, either via cable or wirelessly, I just see a dark screen with the mouse and mouse trails only, can any one help?

    jpmarkques post is a good start point, after folling his directions, you can try detect displays. Also try different rsolution and refresh rates.
    Most of the projectors I have used support a 1024X768 res.
    Youcan also try a pram reset if it still does not detect.
    Leave theproctor connected and powered up, power down the MBP.
    Power back up the MBP and hold the following keys before you hear the start up chime:
    Option, command, P,R (no commas) continue to hold these keys till you hear the start up chime 2 times.

  • I accidentally quit my CC on my Macbook pro and now the cloud icon is grayed out and every time I hover over it with the mouse I get the spinning beach ball of death on the icon. I have no idea how to open it because when I use spotlight search to open it

    I accidentally quit my CC on my Macbook pro and now the cloud icon is grayed out and every time I hover over it with the mouse I get the spinning beach ball of death on the icon. I have no idea how to open it because when I use spotlight search to open it it gives me a message saying "Creative Cloud is not open anymore" help!

    Since you didn't include any pertinent info such as the Mac model and OS version you are running, here is some general information:
    Mac OS X: Gray screen appears during startup
    Depending on which OS yours came with originally - and which OS you are now running - you would either need your original install disks - you can call Apple for replacements by giving them your serial number. Or you may be able to reinstall the OS by using recovery (again, depends on which model/which OS).

  • Is there a way to switch the right Ctrl with the mouse's rick click tab in the new X1 carbon?

    Hi,
    I just bought my new X1 Carbon and I was looking for a way to have the tab with the right click function (generally it is showed as a small window with the mouse arrow on it in bigger keybords) instead of the right ctrl button.
    Thank

    You should be able to do that with the [https://addons.mozilla.org/en-US/firefox/addon/710/ Menu Editor] add-on.

  • With streaming music files I used to be able to hover over the file with the mouse and see a "Download" option. However, after a recent uninstall and reinstall of FireFox, I no longer see this option. Please help!

    Even with files I used to be able to see the download option with (Quicktime files) I do not see the option when I hover over it with the mouse.

    Which add-ons do you have that say "incompatible with Firefox 5.0"?
    Maybe something like download helper? You need to find an update for that add-on.

  • My Acrobat 9 Standard has stopped allowing me to move thumbnails with the mouse.

    For some unknown reason my Acrobat 9 Standard has stopped allowing me to move the thumbnails with the mouse to change the order of a PDF document.  I've tried reinstalling.  I'm at my wits end on this one...

    Try updating to version 9.5.2.  I seem to remember that one of the earlier updates did this and a later update rectified the issue.  I don't have that issue with 9.5.2

  • In iPhoto, how can I export images with the metadata - including the title and caption information - intact as part of the image?

    In iPhoto, how can I export images with the metadata — including the title and caption information — intact as part of the image?

    Check those boxes in the export dialogue - Exporting From iPhoto
    LN

  • Premiere Elements 13 issue with the mouse on When I select a clip of video and move to a different place in my time line, Premiere Elements 13, will not release the clip rom the mouse.    The clip follows my mouse movements and goes to other places in my

    Premiere Elements 13 issue with the mouse on MAC OSX Yosemite 10.10.1
    When I select a clip of video and move to a different place in my time line, Premiere Elements 13, will not release the clip from the mouse.
    The clip follows my mouse movements and goes to other places in my time line.
    I try to delete these extra insertions, but the mouse will not release the clip.
    Action I’ve taken: I’ve re-installed Premiere Elements 13. Problem remains.
    This issue has consumed too much of my time and does not go away.  It ruins my video.
    Help please.
    Thanks

    I tried using the Guest Account on my Mac. In the Guest Account, Illustrator works perfect!
    Then I started wondering what processes (tools/tweaks) I run by default on my account. Turned out the problem was called by a little background tool called RightZoom. RightZoom let's the green 'zoom' button always maximize your current window.
    So thanks! Problem solved!

Maybe you are looking for

  • Header in 'gui_download'

    Hi All, I use 'GUI_DOWNLOAD' to download data from internal table to excel.I am passing the heading in the header field of function module. call FUNCTION 'GUI_DOWNLOAD' EXPORTING       FILENAME                = lv_file       FILETYPE                =

  • Client side event for h:outputText... and other JSF component

    Hello friends... I need client side (to use Java script ) event for change in <h:outputText /> or <h:inputText...>. I want to open a popup window when there is a change in there. I donot want to use onblur() for this. Is there any thing for achiev it

  • How to view the Design layout for Status tracking in bw 3.5?

    Hi all, I am new to bps 3.5 ? and i have a status and tracking in the development created by some one.  i am able to execute it, but then i would like to see the desing layout of it. How the layout is design. Can anyone help me on this!! Thanks Pooja

  • Smart objects in 10 - how do they work ?

    Hi, I am just curious...are smart objects editable non-destructively? Thanks for your help. Best, Angus

  • ALV selection not displayed/shown

    Hello, I have a question concerning the ALV: In NW 7.0 everything was fine and working, as of EhP1 the selection for one ALV is not displayed. ...the selection is done alright and also corresponding events are raised. Nevertheless there is no visual