How do I use a MouseListener to act when an imageIcon is pressed (NOT Jb)?

I want to make an image a button (NOT a JButton), as the image says something like "Click me for help".
How do I take advantage of the MouseListener class/methods so that I can perform an action when the image is clicked?
I'm sure there's a way to find out the pixel coordinates when mouse1 is clicked and I could do it from there, any idea's upon getting the coordinates?
Any source of direction is appreciated.

watwatacrazy wrote:
So, if anyone could figure that one out I would be more then happy to give 2 additional duke stars to you. Now, as I mentioned before there must be a way to use e.getSource() when mouse1 and store the coordinates so then I just simply use an if statement to check if that part of the image has been pressed. The only problem, how do I get the coordinates of mouse1 when pressed?
Oh how I enjoy complicating things. :)
+2 stars to Darryl.Burke
Not sure if this is what you are looking for...
        someComponentThatDisplaysYourImage.addMouseListener(new MouseAdapter()
            public void mouseClicked(MouseEvent e)
                System.out.println(e.getX()); //pixels relative to left of the component
                System.out.println(e.getY()); //pixels relative to top of the component
        });

Similar Messages

  • How can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    how can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    If you are just visiting Singapore, then leave the account as it is. If you have moved there, then view your account using the iTunes app on a Mac or PC and change the country/region to your current location and address. If you do not have a bank card, you can fund your account using iTunes gift cards if available in Singapore.

  • How can I use 2 iPhone 4's on same iTunes account, but NOT sync same contacts?

    How can I use 2 iPhone 4's on same iTunes account, but NOT sync same contacts?

    They need to be registered under different Apple ID's.  The initial Apple ID is set when you first start the phone up.  If you've already registered the phone to the iTunes account, back it up to your computer, and then have iTunes do a factory reset.  Go to www.icloud.com, log in with your current Apple ID, select "Find My iPhone," choose the iPhone you want to dissociate from your primary Apple ID from the upper left, and then click the little circled X ("remove").
    When you start the phone, it will have you go through the setup process again, at which time you need to create a unique Apple ID for the device.  You can then restore it from your iTunes backup to get back your apps and other settings.
    Whenever you use the iTunes store, use the login information (Apple ID and password) that you were using before.  Basically, the second Apple ID that you created is purely used for accessing iCloud services, which includes synchronization of contacts, iCal events, and other such things.

  • How do I use a Creative Cloud license when I have limited Internet for months at a time?

    How do I use a Creative Cloud license when I have limited Internet for months at a time?  I proces a lot of photos in remote areas where an application that needs online access would be useless.

    Hi Freewill,
    Please see the Creative Cloud FAQ here.
    Do I need ongoing Internet access to use my Adobe® Creative Cloud™ desktop applications?
    No. Your Creative Cloud desktop applications (such as Adobe® Photoshop® and Illustrator®) are installed directly on your computer, so you won't need an ongoing Internet connection to use them on a daily basis.
    An Internet connection is required the first time you install and license your desktop apps, but you can use the apps in offline mode with a valid software license. The desktop apps will attempt to validate your software licenses every 30 days.
    For annual members, you can use the apps for up to 99 days in offline mode. Month-to-month members can use the software for up to 30 days in offline mode.
    Cheers,
    Michael

  • How do I use Submit by Email button to submit form as document, not data file?

    How do I use Submit by Email button to submit form as document, not data file?

    Hi
    Just configure your submit button to submit as PDF instead:

  • Please advise how I can register my Photoshop Starter Edition when I apply I do not receive an unlock code so I am unable to continue to use the program and all my photos are locked in, please advise, thanks John

    Please advise how I can register my Photoshop Starter Edition when I apply I do not receive an unlock code so I am unable to continue to use the program and all my photos are locked in, please advise, thanks John

    Please refer to the appropriate Forum, this one is dedicated to Photoshop proper.
    Photoshop Album Starter Edition

  • HT1657 I rented a movie and accidentally hit the menu button and now I can figure out how to go back and watch it . When I try to press rent again it says you have already downloaded this movie go to settings and check for downloads but I can find it.

    I rented a movie and accidentally hit the menu button and now I can figure out how to go back and watch it . When I try to press rent again it says you have already downloaded this movie go to settings and check for downloads but I can find it download in settings.

    I had the same issue with my apple tv 3rd generation. I rented Sinister and selected the "rent and watch now" option. Half way through the movie I accidentally pressed the menu button. When I looked for the rented movie on my apple tv I could not find it. Not even above the movie pannel where "purchased" and "top movies" comes up on the main menu. the apple tv suggests to go to settings>downloads but I don't have that option. I did go to settings> itunes store> check rentals but that didnt work either. It took too long to even check. Thank you because this SOLUTION worked great.
    SOLUTION: How to reset apple tv 3 3rd generation to view rented movies:on the apple tv remote: press and hold "menu" to go to the main menu. Select SETTINGS> GENERAL >RESET >RESET ALL SETTINGS. After the apple tv resets, input all your information again and your rented movies should be visible when you cruise above the "movies" section. THANK YOU!!
    Apple needs to solve this issue because honestly it took me 3 hours and a half to watch a movie that only lasted 2 BECAUSE I wast trying to solve the issue, reseting and all. blahh.

  • How can I use "write to spreadsheet" during the data is taking but not the end of all the loops

    Hi,
    I have to run an experiment on Labview 6 or 5. I don't have Labview 7 on that computer for some reason. My experiment is talking about 1000 hours, and I have a probelm on storing the data. Right now I am using "Write to spread sheet" and I set the "append" to false. And the data is installed at the end of the experiment, that means after 1000 hours. In the mean time if somthing oges wrong like power cut or what, I will lose all the data. So what I want to do is to save the data evertime when the data is took. I tired to set the "append" to true, but it does not let me to choose the "file path"--- when I choose this and select write on new or excisting file, it said" you may not be able to save on a exciting file" and it does not let me create a new file either. If anyone have the lidea like how can I use the "wrtie to spreadsheet" function and at the same time can install the data everytime inside the look, please let me know. Thanks alot.
    KL

    KL,
    It sounds like you want to periodically save your data so it is in smaller files. (great idea) For this operation you will not want to append the data...if something happens to your system while the file is open it could become corrupt and ruin all the data. You need to write the new block of data to a new file every time. Now...this depends on how big your data is...if you only have like 500k of data to write in a block you should probably write several blocks before starting a new file. I don't know enough about how much data you are acquiring. In either case...the write to spreadsheet file.vi will need a different name each time it is called and you will not want to append. Append = false.
    -Brett

  • Hi please help me how can I use my iPhone 4 I am at vocation my is not working please help

    Hi I am at vocation at Italy I am not able to use my phone please help me how can I use my phone overseas thank u

    You need to make your own ringtones in iTunes then sync them to your phone. Follow the directions here:
    http://osxdaily.com/2010/09/04/make-free-iphone-ringtones-in-itunes-10/

  • How to retain the java applet generated code when back button is pressed!!

    I've a jsp page in which i've wirtten the code which specifies the word which i write in the text box, then through the applet i'm showing the word which is written in the text box. It means my applet is running and it show the words which i've written in the text box. Now when i click on submit it goes to the next page and when i click on browser's back button then except the applet generated code everyone retains its values. Is there any way to find it out when it encounter the back button click then applet should be restarted. so in this way without writing the whole application form and in the applet generated code i can submit it again.
    My question is how do i reatin the applet generated code when a click button is being pressed (b'coz for the textbox, textareas everything retains it)
    any suggestions or guidance are most welcome.
    thanks in advance....

    you don't need to navigate explicitly. Just clear the back stack till your specific page and say goback. below is the  code you can use.
     protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
                        e.cancel=true;
                    RemoveBackStackTillSpecificPage("page2.xaml");
                    GoBack();
    public static void RemoveBackStackTillSpecificPage(string pageName)
    PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
    var previousPage = frame.BackStack.FirstOrDefault();
    if (previousPage != null && previousPage.Source != null)
                    while (!previousPage.Source.ToString().Contains(pageName))
                        frame.RemoveBackEntry();
                        previousPage = frame.BackStack.FirstOrDefault();
            public static void GoBack()
                PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
                LastPageUri = frame.Source;
                frame.GoBack();
    Please mark this as answer if this answers your question
    Purushothama V S

  • How can you soft reset an iphone 4s when power on/off button not working

    How can you soft reset an iphone 4s when your on/ off button is not working?
    My voicemail messages are unobtainable and i'm trying to work out how to fix this.

    Sorry you don't.

  • How do I use Airport Extreme to act as a wireless receiver for a Mac Pro?

    Hello -
    I'm trying to use an Airport Extreme (1st Generation) as a wireless receiver for a Mac Pro but I can't figure out how.  My main modem / wireless router (non-Apple) is upstairs.  My Mac Pro is down stairs.  I'm looking to get internet connection for that Mac Pro downstairs.  Is it possible to use the Airport Extreme to connect the Mac Pro to the wireless internet provided by my wireless router?
    Thanks for the help.
    Nathan

    Is it possible to use the Airport Extreme to connect the Mac Pro to the wireless internet provided by my wireless router?
    Unfortunately, Apple designed their routers to work with other Apple routers. It would be extremely unilikely that the AirPort Exteme could be configured to work with a router from another manufacturer.
    The AirPort Extreme would need to be configured to "Extend a wireless network", but an error message is almost surely to occur when you try this.
    There are other alternatives, but they would involve more hardware. Post back if you are interested.

  • How do I use itunes with multiple iphones when syncing each one

    When using one computer how do I make sure each iphone doesnt get all the contacts when I have multiple i phones?

    How to use multiple iPods, iPads, or iPhones with one computer

  • How do I use my Iphone 4s camera while on a cruise, yet not receive texts and calls and ultimately , the charges?

    Hi!!!   My family is going on a cruise this summer.  I do not want to but any internet plan on board or through verizon, as it can get quite costly with
    two teenage daughters.  But, we will be using our phone cameras.  How do I block calls and texts, yet still use the camera? And does blocking them still result in no charges..roaming, international, on board, etc.?  Thanks for all advice and answers!!!

    Another option you may have is to temporarily suspend service...that would guarantee you won't have any charges for unexpected texts/calls. Might be a little more extreme then you want to do though. Contact VZW for more details on that option if interested. I would echo the idea of just using a camera versus your iPhone unless for some reason you don't own an actual point and shoot camera. You can easily put the pics on your iPhone when you return home from your trip if that is the reason you were really wanting to use the iPhone for picture taking.

  • Importing to iMovie: How do I use an external usb mic when recording with the built-in FaceTime HD Camera?

    Hello all
    I'm scheduled to work with a friend this week; I'm going to help him make a simple audition DVD.  I promised him I had the necessary equipment and such.
    I was importing from the webcam using iMovie.  If I can't use my external mic to record for the video, there is more involved in the editing process.   I was hoping to record the video and audio into one package.  I'm using the built-in FaceTime webcam on my macbook pro and a ZoomH1 on usb.
    I've tried changing the audio in system preferences: input to H1.  This works when recording with audacity or anything else.  I even changed the input on FaceTime to H1.  There aren't any preferences I can find in iMovie to change the input for importing video directly from the webcam.
    How do I change the audio input for direct import on iMovie?   
    OR
    Is there something else I can do to have HD video and HQ audio captured in one video file on my macbook pro?
    I suppose I can record the video and audio separately but that is usually much more involved.  This is why I got this usb microphone lol.
    Thanks in advance,
    -Seth

    I just found using QuickTime Player to record a movie works great.  I can easily change the audio input.  iMovie is silly. lol
    If I missed anything let me know.
    Thanks
    -Seth

Maybe you are looking for

  • How to send email using u201CSO_DOCUMENT_SEND_API1u201D without attachment.

    Dear Expert, I am using the folowing code to get the content of smartform as otfdata :       CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'         EXPORTING           formname           = v_formname         IMPORTING           fm_name            = v_fm_na

  • Is there a maximum number of keywords in Lightroom 4 on Windows XP?

    A friends finds that near the end of a long list of keywords in the Keyword List pane, the right-pointing arraow to the right of the keyword fails to appear. If she adds three new keywords above that point, the point moves up three, suggesting a maxi

  • Opening migrated files

    I have successfully migrated files from G3 to MacMini, but MacMini will not open files created with ApleWorks 5.0. iWorks09 has been installed on MacMini, but always responds with "files created with unsupported format" message. What can I do?

  • GrabXML('f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:FLOW_FOP_OUTPUT_#REGID

    Would anyone know of the equivalent Portal 10.1.4 call for Step 4: Add PDF Link to Report Screen as stated in Rendering Oracle HTML DB Reports as PDFs Using Formatting Objects Processor -- http://www.oracle.com/technology/pub/notes/technote_htmldb_fo

  • IOS vs Android background audio differences.

    I'm using Flash Pro CS6 / Air 3.2 to port to iSO and Android. On iOS, when the app exits via the Home button or is closed using the Lock button, the audio is essentially "paused" for me without any code and starts up again when the app regains focus.