JButton with Icon - when pressed moves Icon

When I press on a JButton which contains a icon then the icon is moved a little bit each time I press. Can I disable that?
I need to place clickable images. Is a JButton the best method for this?

URL url = this.getClass().getResource("weiher_original.jpg");
ImageIcon icon = new ImageIcon(url);
btnIcon = new JButton(icon);
btnIcon.setSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
btnIcon.setBorderPainted(false);
btnIcon.setFocusPainted(false);
getContentPane().add(btnIcon);Now if you press on the icon the image moves a few pixels until the mouse is released.

Similar Messages

  • After Compressing file with Compressor when somthing move in the picture

    After Compressing file with Compressor when somthing move in the picture , it will get a kinda interlaced in the edges of it , the orginal files was Uncompressed DV and I add subtitle on it and then used the 90 min best dvd preset for it .
    I really need some help .
    thanks a lot .

    I would take  a step back here before going further.  William's suggestion might very well clean up the library but something obviously did not go right and to start mucking about in the library might make things worst.
    For starters I'm surprised to see the folder structure you showed in your first post. Aperture stores managed masters (originals) by import date and time. The structure (in all libraries I've ever seen) looks like:
    So something seems wrong with your master folder.
    Also the three folders you showed the first and third are identical ( the middle one has the (1) added to which is how the OS handles duplicates in a folder) so this shouldn't even be possible, those folders should not be there.
    I'm wondering if this is something left over from your using Duplicate Annihlator. Do you have a copy of the library before you ran the merge and used DA on it? Would be interested to see what the master folder looks like.
    Finally when you ran the merge which library did you tell Aperture to use as the master, the one that was used to resolve conflicts?
    Again William's suggestion might be all you need to do but it would be good to figure out want went wrong before proceeding.
    regards
    Message was edited by: Frank Caggiano - A better first step might be to run the Aperture first aid tools, repairing and possibly rebuilding the library.

  • When press phone icon on iphone it closes?

    For some reason when I push the phone icon on my iphone it opens then closes? I don't know what happend and it was working before..Can you please help me?
    Thank you

    Have you tried powering your iPhone off and on?
    If so without any change, next try a reset, which is done by pressing and holding the Home button and the sleep/wake or on/off button simultaneously until you see the Apple logo and then release - ignoring the slide to turn off prompt when doing so.
    A reset is similar to a computer restart.

  • Markers on clips don't move with project when switching media drives

    Here's an odd one. I'm editing a project in Premiere Pro CS6 and in order to avoid carrying drives back and forth between two editing locations, I cloned the footage drive and have one duplicate drive in each location. I'll call them location A and B.
    I have no problem relinking clips when I move back and forth from location to location. That's all working great, as expected.
    When I am reviewing clips at edit location A, I've been placing a marker on the hero moments to make them easier to find later when editing. The strange (or perhaps perfectly normal) thing is that when I move to edit location B and relink the clips, all of my markers that I made at location A are gone.
    The same thing happens when creating markers on clips at location B. When I move to location A, the markers made at location A are there, but the new ones added at B are gone... until I return to location B.
    In other words, it seems like markers are not saved as part of the project, but are saved within each clip file. If that's true, what I'm experiencing would make sense. Even though I'm relinking the clips when I change edit locations, the markers are part of the footage files on each of my duplicate drives and do not move with me when I change locations.
    I just wanted to confirm this is "how premiere pro works," or see if there is a preference checkbox or workaround I'm not aware of. Maybe I've found a bug? If this is just how it is, I'll have to come up with an alternate way to mark footage I'm reviewing, or just move the drives with me when I move, which I'd love to avoid.
    Thanks for any thoughs on this anyone has.
    Billy Sheahan
    Chicago, IL

    Wes, my deepest apoligies for not responding to your kind answer sooner. I had moved on, thinking it was just one of those things, until another editor colleague of mine, found my original question recently and emailed me to find out if there was a solution.
    It appears that even with Premiere Pro CC, copying the XMP sidecar files to the second media drive remains the answer. Sadly my editor friend did most of his pre-edit clip marking in one city and traveled several states away to begin the edit and when he arrived, all of his marks were, of course, not there.
    It would be great if somehow the metadata could be tied to the project, rather than the sidecar XMP files. Perhaps not technically feesible, but it would certainly make more sense from an editing standpoint to not have to be copying sidecar files every time you move to a edit location with duplicate media drives.
    I will most likely write a feature request to see if this can be achived in future versions of Premiere.
    Thanks again for your support and reply.
    Billy

  • I was moving icons and my Settings icon disappeared

    i was moving icons when my Settings icon disappeared.  How do i get it back?  resetting did not work.

    From allan778,
    The settings app cannot be deleted. Try searching for the Settings app in Spotlight and see which folder it is in. The folder name will be displayed on the right.

  • When I used mountain lion in a preview of a picture I could just press the icon that was a box with an arrow pointing up and that would allow me to share (message, email, Facebook, etc) the image.  Now in Yosemite in preview if I click the box-arrow

    When I used mavericks in a preview of a picture I could just press the icon that was a box with an arrow pointing up and that would allow me to share (message, email, Facebook, etc) the image. Now in Yosemite in preview if I click the box-arrow

    Found my answer in another thread-  this is what I did
    GO to System Preferences > Users > Right Click on your Name > Advanced Options > and refresh your UUID
    Restart your System and the widgets are all back
    This solution worked fine for me!

  • Multiple icons when right clicking a movie to open with VLC.

    Hi,
    I have a strange problem that is more annoying than anything else. When I right-click a movie to 'Open With' VLC there are 4 icons there for VLC. (see attached). How do I get rid of them? Why are they there?
    Thanks in advance for the help.
    Cheers

    I found a solution at
    http://andywarburton.co.uk/2007/05/how-to-fix-multiple-items-in-the-mac-osx-open -with-menu/comment-page-1/#comment-4082

  • There is a little camera icon on a movie clip when I try to import it to iMovie from my iPad. I have reimported several times with the same result. When I disconnect the iPad I can no longer view the clip. Help!

    There is a little camera icon on a movie clip when I try to import it to iMovie from my iPad. I have reimported several times with the same result. When I disconnect the iPad I can no longer view the clip. Help!

    Hi eawaters,
    If you are having issues importing video from your iPad to your Mac for use in iMovie, you may find the following article helpful:
    iOS: Import personal photos and videos from iOS devices to your computer
    http://support.apple.com/kb/ht4083
    Regards,
    - Brenden

  • I did force shutdown on my MacBook Pro (2006 year, 15.4"), so, when I tried to boot, it shows apple logo (as usual) and shuts down. When I booting MacBook with Option key pressed it shows lock icon and field for password. Please help me.

    I did force shutdown on my MacBook Pro (2006 year, 15.4"), so, when I tried to boot, it shows apple logo (as usual) and shuts down. When I booting MacBook with Option key pressed it shows lock icon and field for password. Please help me.

    Wait for advice on repairing a damaged filesystem.  Forceshutdown stops processs in mid-stream and leaves some parts not-valid.
    Do not proceed until you get that avice.

  • HT204088 Using my ipad 3, with ios6, I can access the itunes store and the App store when I press the icons, but the viewing pages are blank. I can see the toolbars at the top and bottom. The pages are blank for every tab. Help. The ipad works fine, other

    Using my ipad 3, with ios 6.0, I can access the itunes store and app store by pressing the icons, but the screens are all blank pages, I have tool bars at the top and bottom of the viewing screen, but when I touch the individual tabs, the viewing screen is either white or dark grey...nothing else appears. Help.

    Having the same issue, can someone please enlighten us?

  • Has anyone had problems with unable to rent movies from apple tv? I can watch movies on Netflix fine but when I click on the Movies Icon it acts like it's about to show the movie selections then it goes right back to the home screen!! Please help!!

    I can watch Netflix fine from Apple tv but when I click onto the Movie Icon it acts as if it's about to show the movie rental selection then goes back to the home screen. Please help!

    My problem was solved by Winston Churchill. Step #2

  • HT201365 When I upgraded my iPhone 4s to IOS7, I lost all my app icons. Where did they go? Interestingly they are still listed in notifications and I could play words with friends when I got a message on the home screen that it was my turn (but still no i

    When I upgraded my iPhone 4s to IOS7, I lost all my app icons. Where did they go? Interestingly they are still listed in notifications and I could play words with friends when I got a message on the home screen that it was my turn (but still no icon)

    Hey linfrommi,
    Thanks for the question. I understand that you are having trouble locating some application after the update to iOS 7. To troubleshoot this issue, let’s reset the home screen layout of your iPhone, which should move all of your applications to the second “page”:
    Reset iPhone settings - iPhone
    http://help.apple.com/iphone/7/#/iph7a2a9399b
    Reset Home Screen Layout:  Returns the built-in apps to their original layout on the Home screen.
    Thanks,
    Matt M.

  • How to change the mouse cursor icon type when mouse moves out of client area ( propertysheet) WTL?

    I got stuck with an issue in property sheet .I want to load different cursor when the mouse position is within the client area and load another when moves out of the client area.
    In the porpetysheet I added four page. In the first page when I click next I am loading cursor of IDC_WAIT type and loading IDC_ARROW when the mouse moves out of the client area.
    In the page class I triggered the event for WM_MOUSEMOVE as follow:
        MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
    LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    if(TRUE == m_bIsNextBtnClicked)
    ::SetCursor(LoadCursor(NULL, IDC_WAIT));
    else
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return TRUE;
    This event is getting triggered and absolutely had no issue with this. Similarly I tried adding `MESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)` this event making an assumption that this will get triggered if the mouse moves out of the client area,  but
    this event did not get triggered at all.If this is not the mouse event to be triggered for mouseleave which event should I trigger?
    LRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return TRUE;
    Now when I click Next button , **I was actually calling a function which is taking sometime to return** . Before to this function I am loading IDC_WAIT cursor i.e., 
     `::SetCursor(LoadCursor(NULL, IDC_WAIT));` . 
    Now when move the mouse cursor on to the non-client area I want to load IDC_ARROW cursor i.e., 
        ::SetCursor(LoadCursor(NULL, IDC_ARROW)); 
    When the moves on to the non-client area I am handling the mouse event in sheet derived class as follows,
    MESSAGE_HANDLER(WM_NCMOUSEMOVE, OnNCMouseMove)
    LRESULT OnNCMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    ::SetCursor(LoadCursor(NULL, IDC_ARROW));
    return 0;
    This event is not getting triggered until unless the function in the Next button event is executed.
    I want both of them to be done in parallel i.e, click Next button now hover mouse on the client area, Busy icon should come and when mouse moves out of the client area then IDC_ARROW icon should come.
    LRESULT OnWizardNext()
    ::SetCursor(LoadCursor(NULL, IDC_WAIT));
    m_bIsNextBtnIsClicked = TRUE;
    BOOL bRet = MyFun();
    m_bIsNextBtnIsClicked = FALSE;
    //Until this function(MyFun()) is executed **WM_NCMOUSEMOVE**
    //event is not getting triggered.But this event should get triggered and I
    //should be able to see the change of cursor within and out of client area.
    Can anyone kindly help me to solve this issue.
    SivaV

    Hello
    sivavuyyuru,
    For this issue, I am trying to involve someone to help look into, it might take some time and as soon as we get any result, we will tell you.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to put an icon to Jbutton with Jbuilder 5?

    I have tried to make a jbutton with icon on it,
    i create an image icon object and pass it to the jbutton.seticon method...
    When create the image icon, it need the path of the icon file, what is the relative path of image in jbuilder?
    (not absolute e.g file:///)
    Thanks

    What you need to do is
    if your current class is Test and you image file is in the same directory called cat.gif then do the following
    button.setIcon(new ImageIcon(Test.class.getResource("cat.gif")));
    this should work
    if you image file is in the previous directory you just type in "../cat.gif" and if you have a image directory reltaive then you put in "images/cat.gif"
    I hope this helps

  • JButton with Icon question

    In the Toolbar I have a JButtons. I created the JButtons with Icons.
    When I click on a button it is putting a dotted line right around the Icon. How can I get rid of that? Thanks.

    You're talking about the focus rectangle. If memory serves in the SwingSet demo there's an entire panel devoted to buttons and such. You can find something there to help you. The toggle in the example is labeled "Paint Focus", and it does what you want.

Maybe you are looking for

  • Copying text in Sql*Plus

    I seem to be unable to copy and paste text using the "highlight text and right-click" procedure in Sql*Plus 8.0.6.0.0. The right-mouse button seems to work in everything else so it doesn't seem to be the mouse that is the problem. Does anybody know i

  • What is bookmarkbackups folder for?

    there is a folder called bookmarkbackups in profile directory what is bookmarkbackups folder for? can I delete the file inside?

  • System landscape changes after activating charm

    I need to change the system landscape on a maintenance project. I need to add an additional QA client to the project landscape. I have open change requests that I can not move to production yet so I can not complete the project. I have created anothe

  • Ipod only works in fm transmitter

    my ipod only works when plugged into the fm transmitter. Once i remove it, it turns off and i can't get it to turn back on. It also isn't being recognized when i plug into computer everything from my itunes is still there but the ipod won't even turn

  • Multi approval process

    Hi Idm gurus, I have a requirement in whcih I have 3 approver to create a user. If any 2 approver is approving I need to go ahead and create user in resources. Can some one guide me how to achieve it? Thx