How can I move some image on JPanel ?

How can I move some image on JPanel ?
I want to move it with my arrow keys.
Plees, give me example code

1) Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html]Using Layout Managers. You would need to use Absolute Positioning so you can control the position of the image
2) Add the image to a JLabel and the label to the panel
3) Read the tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html]How to Use Key Bindings. Then you just assign an Action to each of the arrow keys and use setLocation(...) to move the label.

Similar Messages

  • How can i save some image- profiles in the memory (RAM) of a system?

    How can i save some  image- profiles in the memory (RAM) of a system?
    (and then I want to read out the memory and save the profiles in a HDD, but first it has to write in a memory, because the write-speed is better by the memory )

    There must be an underlying premise for this question that I'm missing... When you run code everything is in memory... Programming 101. Create a variable, set a value to it, and it's in memory. Create a front panel control set a value to it and it's in memory. Data carried by the wires you use to connect your code is in memory. Or are you asking about controlling how that memory is managed - physical vs swap file?

  • How can I move/relocate images in Dreamweaver?

    Hello, I'm 16 years old and just went on a mission: My dad's shop has no website, and recently in school we've been taught the most basics of how to design a website. So I set myself a personal goal, to create a website for my dad! I know it will take time and I will be struggling alot, and here after about 20 minutes work I'm already stuck. How can I move images?
    I don't know what version of dreamweaver I'm using, but I only just downloaded it (30 days trial) from adobe.com so it must be the newest version.

    In DW Help Menu > About Dreamweaver shows the version and build #
    First, define  a local site folder. 
    Go to Site > New Site.   Tell DW where you want to keep your site files on your local hard drive.  See screenshot.
    Nancy O.

  • How can I move some track from music folder to the podcast or audiobook?

    I have a lot of audiobook in my hard drive.When I add these files to library,they place in the music section.How can I move Them to the audiobook section?
    I've tried to chenge their genre to the Podcasts or Books,but there is nothing happened.

    So, if she purchased a song from iTunes in her library, I will also have to purchase the same song to add to my library?

  • How can I MOVE some projects from one library to another?

    As the aperture library grows quite big and I want to split it into several smaller ones. How can I move projects from the old library to a new one without export them and re-import them all again? Is it possible to retain all adjustments after migration?
    Thanks!

    You export the project by CTRL / Right- click the project and choose 'Export' > 'Project'. The same if you go via the file menu.
    Every adjustment you made, books created, albums etc. will be kept in the exported project and are available again when you import it to another library.
    Regards
    Paul K

  • How can I move an image/file around inside a document with text already in it?

    I'm learning In Design on the job, and it's a real challenge.  One big problem I'm having is, after I've placed an image inside a document with text in it, how do I place it precisely where I want it?  Sometimes I need the image flush to the left, and sometimes I need to center it.  When I place it, it doesn't land where I need it to be.  Things I've tried work sometimes but not other times.  I've tried going to Paragraph and reducing the setting to zero to move an image flush to the left of the text frame/column (I'm working with a three-column page).  Sometimes that works, and sometimes it does not.  When it doesn't, I've tried using the Selection tool to drag the image, but it doesn't respond.  Could someone give me an idea of what I'm overlooking?  I'm finding that InDesign has many settings, and all it takes is for one setting to be what it shouldn't be for things to go badly wrong.  I'm having other issues too, but in this discussion I'll stick to this.

    Sounds like you are anchoring the images in the text flow. That's fine if you need them to move along with text during editing, but is usually not required and often counter productive. If you place your images as separate objects in their own independent frames they can be positioned anywhere and moved at will. If they need to be anchored, consider using Custom Positioned instead of inline.

  • How Can I Move the Image in the Workspace to Align with 0 on the Ruler (CS5)?

    I am completely new to Photoshop (CS5) so I don't know all the correct terms to explain my problem but I'll try.  I'm working on a computer with Windows 7.
    I open a RAW image and edit it to my satisfaction, and then I "Open Image" in CS5 to do a little more with it, mainly crop it.  I have adjusted the rulers so zero is near the upper left corner.  I want the image's upper left corner to snap to the 0/0 ruler point on the screen.  I can't get the image to move at all.  I've tried Move, Hand. Select and Move, Snap To Guides, and everything else I can think of.  The reason I want to do this is so I can see the image when I have an Image Adjustment window open (Sharpen, Levels, etc.) -- all those "working" windows cover up the image and/or my panel on the right side of the screen.  An odd thing is that the horizontal ruler goes clear over to the right side of my screen, above the panel, and this places my image smack in the center of the screen instead of the center of the workspace (the screen minus the panel and the list of Tools).
    Any suggestions would really be appreciated!   This is a very frustrating problem!

    Sounds like what you want is Window > Arrange > Float in Window. This puts the image into a seperate, normal window, rather than the tabbed interface that Adobe has foisted on us (Float in Window used to be the default).
    When viewed as normal windows, if you ALT + CTRL + plus or ALT + CTRL + minus, it will zoom in and out, expanding and contracting the window to fit.
    For the Toolbar, if you drag it to the left of your screen, you can dock it to the left edge. When the toolbar is docked, other windows won't open underneath it.
    Another handy shortcut when you find all your panels distracting is the H key, to show/hide the "Extras". Be sure to set it back to "Show" when you're done; it's all too easy to be wondering, "Why isn't my paintbrush working?", only to realize you have and active selection hidden.

  • How can i grabb some image using an usb video grabber in Labview 7?

    How can i make a list with all video and audio devices?
    How to use DirectShow functions in Labview 7?

    Hi,
    I can help you out with the audio part of your question: the Windows API has a set of functions called waveOutGetNumDevs and waveInGetNumDevs that give you the number of available devices for input or output. Then you can use waveInGetDevCaps and waveOutGetDevCaps to get more information on each device; with some work you could get the manufacturer and formats supported.
    I have very limited knowledge on DirectShow; however it is based on COM so you shold be able to access it with LabVIEW's ActiveX capabilities.
    I hope this helps.
    Regards,
    Juan Carlos
    N.I.

  • HT4946 From the backup folder how can I move the images from there?

    I just backed up my iphone and I went into the back up folder but you cant save the images, how can I do this?

    You would need 3rd party software to extract photos from a backup.  Instead of doing that, just import them from the camera roll using your usb cable: http://support.apple.com/kb/HT4083.

  • My daughter and I each have iTunes libraries on the same computer, how can I move some songs from one library to the other?

    My daughter and I each have iTunes libraries on the same computer, how can songs from one library be moved to the other?

    So, if she purchased a song from iTunes in her library, I will also have to purchase the same song to add to my library?

  • How can I move some files (but not all) in the photostream folder on my PC to another folder on the PC?

    I have photostream set up on my PC and all photos in both mine and shared photostreams are successfully being synced to my PC automatically. However, my goal is to navigate to the photostreams on my PC and be able to move them and edit the photos with other software I have. I'd like to move more one at a time as I have 100's. This would help me better sort them as well as free up some much needed space on my iCloud account as I don't need all these photos available at all times, but also don't want to lose them. Is there a way that I can do this? I really appreciate any help I can get.

    Your my photo stream folder should operate the same way other folders do.  First go to the iCloud control panel for Windows and click Options next to Photo Stream.  Here, note you photo steam location (listed at the bottom).  Navigate to the photo stream folder at that location, then open the my photo stream folder inside.  Right-click on the my photo stream folder, select copy, navigate to a location of your choice, then right-click and select paste.  Click on the copied folder, press your F2 key and rename it something like Photo Stream Backup.  Then you should be all set.

  • I have transferred my pictures from a PC to iPhoto but some have remained in a pictures folder. How can I move them to pictures?

    i have transferred my pictures from a PC to iPhoto but some have remained in a pictures folder. How can I move them to pictures?

    what is WP files?
    You want to always use iPhoto with a default referenced library (the preference to copy imported item to the iPhoto library is checked) ad then delete the source photos
    LN

  • How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    It sounds like you are talking about the cloning tool?
    Tool looks like this:
    Then when selected you can change the size of the brush and using Alt (windows) and Command (Mac) to select your region you want to copy then start to create you cloned image.
    Hope this helps?

  • How can I insert an image into an mov file in iMovie while keeping the background music?

    I have a short MOV file movie clip that has background music but one of the images (it's a static element with text) is incorrect. How can I replace the image but keep the backgroup the same? Also what size would the image need to be to properly fit?
    Thank you!

    Hi hyue,
    Thanks for visiting Apple Support Communities.
    If you would like to add an image to a project in iMovie for iOS, see this article for helpful steps:
    iMovie for iOS (iPad): Add photos to a project
    http://support.apple.com/kb/PH3171
    All the best,
    Jeremy

  • My video was recorded on my I phone 4, the camera was held sideways for a horizontal view, but loads in I movie vertically.  How can I rotate the image so it is horizontal?

    My video was recorded on my I phone 4, the camera was held sideways for a horizontal view, but loads in I movie vertically.  How can I rotate the image so it is horizontal?

    Drag the clip from your Event to your Project. Then use the Rotate, Crop, Ken Burns Tool on the Middle Toolbar to rotate it

Maybe you are looking for

  • Enhance bapi_0035_create

    I need to enhance bapi_0035_create, becasue there are additional fields in GMGR table. After enhancing I need to use the BAPI in LSMW. What is the best approach for this? Looks like I this bapi_0035_create does not have enhancement option!! Please he

  • How to setup tab in a pdf form

    can someone explain how to set tabs in a writeable pdf form

  • How to get the number of rows in a DB-Cursor

    When i open a database cursor i do not know how much rows are stored in the cursor. To solve this problem i have to send a 'select count(1) ...' to get the number of rows before i set up the cursor. I think that this is not very clever and could poss

  • SoftReference and WeakReference clearing

    According to the javadoc of SoftReference: http://java.sun.com/javase/6/docs/api/java/lang/ref/SoftReference.html: Suppose that the garbage collector determines at a certain point in time that an object is softly reachable. At that time it may choose

  • How to extract to/from partner ID from filename

    Hi, I have a use case where I'm reading a flatfile, transform and writing XML to a filesystem. I have done the following: - Setup both MyCompany and the PartnerA profiles - Created the flatfile schema. - Setup agreement between both partners - Deploy