How do you make the "mouse down event" achnolage the area of an image

Hi
I am trying to program a simple game.
In this game I would like to insert
giff images, that when "clicked on"
by the mouse, will finallly return some kind of action.
In the book that I am reading, I have learnt how to
use the basics of the "mousedown event".
This I found out would be no use to me for what I am trying to achieve
at this moment,
because it only alows me to choose one coordinate at a time.
Is there any class that will able me to click anywhere on the "area" of the giff image instead of only one coordinate?
I hope I am clear enough..

And this is how you create the JLabel:
JLabel j = new JLabel(new ImageIcon("yourImage.gif"));

Similar Messages

  • Newbie Question...  How do you make sure java can find all the imports

    Hi everyone,
    I am new to Java and so far I really like it. But I am having problems porting applets to my websites. How can you make sure that all the references can and will be found in the applet...
    for example,
    I import javax.media.ControllListener in a project I am using and it works great in the applet viewer but when I try to port this to my website I'm working on, java can't find it. I really would appreciate any help on this cause then I would have java power :) and will keep me from losing my hair :).
    Thanks for those who help me.
    - Stan

    Hey jwenting,
    Thanks for the quick response. Classpath definitely makes sense so I have been reading up on that... But do you include .classpath file in your website too? And how would you reference it if you need to reference it?
    - Stan

  • How do you schedule 3 week  recurring events in the calendar ?

    How do you schedule an event in the calendar every 3 weeks ? I work a schedule that reoccurs every 3 weeks.

    Unfortunatley there are certain repetitions that the iPad can't create. However if you make them elsewhere and import it onto the iPad, it'll respect it. So if you sync with a computer, make your appointment there and then import that onto the iPad and it'll be on your calendar.

  • How do you get a "mouse over" event of a line drawn on a picture?

    I am using the "draw multiple lines" vi and want to be able to select a line using the mouse.  From the picture properties I can tell when the mouse is over the picture, but not when the mouse is over a line drawn on the picture.
    Thanks for any help with this.
    Jon

    I think you would have to keep a side database of each object that is selectable and select them from a list. If you look inside some of the picture control functions you will see that it is an array of drawing commands. You don't have access to the z-buffer, so you don't know what pixels were set by their Brenshaw but the z-buffer is the array of drawing commands. If you want to change things that are already laid down then it would have to be more like how visio cycles through the components of groups when you click where each click brings up the control points of the component parts.

  • Sort Artist field: how do you make it's data appear in the Artist list?

    Usually, if I have an album by a particular artist already (e.g. Paul McCartney) and then add another which I want listed under the same artist (e.g. Wings), then there's no problem. I would just enter Paul McCartney in the Sort Artist and Sort Album Artist fields for the Wings album and I'd only have Paul McCartney listed under the artists (in List View).
    However, occasionally this doesn't work and I want to know how to sort it. I imported an album by The Jacksons, entered Michael Jackson in the Sort Artist and Sort Album Artist fields, which resulted in The Jacksons being listed amongst the artists alphabetically as if Michael Jackson, although still displayed as The Jacksons. I then imported a Michael Jackson album and entered the same data in the same fields, and although the albums were displayed together and alphabetically listed as if Michael Jackson, they were listed amongst the artists as The Jacksons. I want to see Michael Jackson listed. I have it that way in 2 other libraries. I think this has occured because I entered The Jacksons' album first in a library which contained no Michael Jackson and therefore The Jacksons have taken precedence. How can I sort this?

    As I see it the *Album Artist* field should keep tracks of an album together when different Artists are credited on an album. It does work this way in iTunes but not on most iPods. The *Sort Album Artist* field is used to control where that Album Artist is listed among others. e.g. to control whether "The Beatles" get sorted under "B" or "T". While linking different Artist values with an overal Album Artist makes sense, I don't think that the logic of Sort Album Artist was ever intended to merge different values of Album Artist.
    Apple don't appear to be working to resolve this issue since it has been evident for quite some time. The workarounds I suggest in the post linked above will give one cover in cover flow, one album in the albums menu and one artist in the artist menu if applied consistently.
    With your Paul McCartney/Paul McCartney & Wings issue for example, my preference would be to use the original album artists as credited. Otherwise change the Artist & Album Artist to "Paul McCartney" and then, if you wish, add \[As Wings\] to the album title or individual tracks. If you used Sort Artist & Sort Album Artist to make "Micheal Jackson" sort as "Jackson, Michael", "Janet Jackson" sort as "Jackson, Janet" and "The Jacksons" as "Jacksons" then all the related artists would be listed in the same place, but remain distinct.
    tt2

  • How do you make a drop-down TOC in Acrobat?

    I'm trying to make a drop-down TOC like in this Scripps Benefits Guide pdf. Does anyone know how to make this?
    http://www.myscrippshealthplan.com/downloads/Scripps%202012%20e-Catalog%20FINAL.pdf

    It uses the app.popUpMenu or app.popUpMenuEx method to create a pop up menu:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.161.html
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.162.html

  • How do you make a "div" tag stretch to the top, left and right?

    Hi, i'm making a professional website on dreamweaver with both codes and WYSIWYG data however i've noticed top, left and right in the CSS script for my div tags. do you know how i can "stretch" the left, right and top to make it look like one of the top div tags on one of these sites:
    http://www.neopets.com/ products div tag above the site that mentions other nick products

    Go into  http://images.neopets.com/css/default.css?v=3
    And change the width of the header from 996px to 100%.
    Gary

  • How do you make a template from muse to the bc?

    I was told to just add a tag_content (in brackets) to a page rather than the A-master page and upload it to bc. Support said that bc would recognize it and put the page into the template folder.. that didnt happen for me.. All i had was a new page with the text tag_content in brackets displayed.. pls help.
    DeVon

    Hi Devon,
    http://helpx.adobe.com/business-catalyst/using/control-sites-look-feel.html#id_1911
    The tag is {tag_pagecontent} and the above link will step you through forming the template.

  • How do you make a back-up copy of the OSX Leopard Install Disk 1?

    I'd like to make a back-up copy of +Leopard Install Disk #1+ but I only have one DVD read/write machine onboard the Mac Pro.
    Can I insert the Leopard DVD, copy it to my desktop, remove it from the drive, insert a blank DVD and burn the contents to the blank DVD?
    I'm trying to create a simple bootable Leopard DVD that will enable me to (a) boot up, then restore my System HD from a Time Machine Archive; and/or (b) run +Disk Utility+ from a source other than the main System HD if necessary.
    I know I can do these things from the original Leopard Install DVD but I'm trying to preserve it and use it as little as possible in the event I need to reinstall Leopard.

    In addition to Malcolm's instructions I want to point out that you need a Dual Layer
    DVD+R (or -R) for this. Those are quite flaky and some might not work or not work well when you burn them. I was recommended Verbatim DL DVD+R as being reliable. try those.
    also, instead of burning to a copy of the install Disk 1 to a DVD you can clone it to a partition on your hard drive. Just make a small partition, insert the DVD, select it in Disk Utility and click on "restore" tab. select the DVD as the source and the partition as the target and hit "restore". this will give you a very fast bootable installer right on your hard drive.

  • How do you make menuTabs open a new inside the tab selected?

    Hi all, I am very frustrated with menuTabs because it won't allow me to open a new page in menuTabs instead it opens my page outside of my tabs . I don't understand why this functionality is not available when all other tab controls function this way. I looked at the showOneTab component thinking may do the job.
    Any help would be appreciated,
    Tony

    This is a configuration in IE. It has nothing to do with jdev.
    I googled it for you http://answers.yahoo.com/question/index?qid=20110605041808AA58rsu
    Timo

  • How do you make a video automatically play when the user gets to a certain point/pixel?

    I'm trying to create a website with a video embedded in using the YouTube widget. I want the video to start playing when the top of the widget reaches the top of the screen, in this case at 400 pixels. Can anyone help? Thank you in advance!

    Provide the name of the program you are using so a Moderator may move this message to the correct program forum
    This Cloud forum is not about help with program problems... a program would be Photoshop or Lighroom or Muse or ???

  • Mouse down event reading a string terminal trick

    Hi,
    I wondered why I was getting frustrated entering a pasword that was verified in the mouse down event of the OK button. This is becuase when you click the OK button the entered text is still in the buffer and not copied to the terminal. (Which is more natural than clicking somewhere on the FP first). Note pressing enter or tab gets the string control out of enter text mode.
    Turns out need update value while typing turned on if you want to gaurantee a correct read of a text input control in a mouse down event. As this is one of those not obvious but sometimes happens bugs... I have posted for reference for others :-)
    Example attached v8.6.1.
    Attachments:
    TestMouseDownEvent.vi ‏13 KB

    Nick wrote:
    Turns out need update value while typing turned on if you want to gaurantee a correct read of a text input control in a mouse down event.
    AFAIK, "Update value while typing" will trigger only a Value Change event of the Str Ctl.
    Mouse Down event will preceed a Value Change event, if you have both the event cases configured in your code.
    - Partha
    LabVIEW - Wires that catch bugs!

  • PDA Mouse Down Event on Picture Control

    While using the Mouse Down Event on the Picture Control for LabVIEW 7.1 PocketPC PDA, I want to get the xy coordinates on where the user tapped on the pict control. Any ideas or workarounds?
    Robert

    Hello Robert �
    What do you mean by �outputting individual horizontal and vertical components�?
    In the LabVIEW PDA module (and this applies to PocketPC and PalmOS), clusters will not show up in the PDA�s screen. You can use clusters to group controls/indicators but when there is need of sending a new value/showing the value in the screen, the bundle and unbundled functions have to be used, so that you can have individual controls/indicators to pass a new value/see the value, respectively.
    So, from the Coords terminal in a Mouse Down/Up event, you need to unbundle the cluster and create individual indicators for each, the horizontal and vertical position.
    I am attaching an example to show you what I mean. For PalmOS, the same applies.
    H
    ope this helps and if I misunderstood your post, please let me know.
    Have a great day.
    S Vences
    Applications Engineer
    National Instruments
    Attachments:
    PPC_Picture_Events.vi ‏30 KB

  • Problems with Mouse Down event for a picture control embedded in tab.

    I noticed that when trying to get a Mouse Down event for a picture control that the Mouse Down will not be 'fired' if the picture is embedded in a tab control. It also appears that this problem exists for other controls (I only tested a slider in addition to the picture). It isn't much of an issue for me now as I can just poll the mouse property of the picture control, but the Mouse Down event has information that I may want access to in my next software revision (button pressed, and Alt mod). I could do that by handling the Mouse Down event for the tab itself and checking to see if the the mouse property isn't -1, -1 for the picture, but that seems a little bit too kludgy (sp?) to me and wouldn
    't address the issue with other control types. Any chance of this being addressed by a patch sometime in the next couple of months???
    Attachments:
    TabProblem.vi ‏69 KB

    The problem I reported above was in LV 6.1.
    As a work-around, I used the mouse down on the tab control and did the math to decide if the picture was clicked.
    I have been told that this was fixed in LV 7.0. I can not confirm.
    You could call NI and ask about the service request number I cited above.
    I hope this helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Detect clicked cluster in mouse down event for clusters within multiple stacked clusters

    With the help of Ben (see http://forums.ni.com/t5/LabVIEW/Determine-cluster-element-clicked-in-mouse-down-event/td-p/1245770)
    I could easily find out what sub-cluster had been clicked on (mouse down event) within the main cluster, by using the Label.Text Property.
    However if you have a cluster within a cluster within a cluster then you probably have to use individual mouse down events for each sub-sub cluster.
    I just wanted to use one "Main Cluster":Mouse Down event and from that determine which of the sub-sub clusters had been clicked on - is this even remotely possible?
    Chris.

    Chris Reed wrote:
    With the help of Ben (see http://forums.ni.com/t5/LabVIEW/Determine-cluster-element-clicked-in-mouse-down-event/td-p/1245770)
    I could easily find out what sub-cluster had been clicked on (mouse down event) within the main cluster, by using the Label.Text Property.
    However if you have a cluster within a cluster within a cluster then you probably have to use individual mouse down events for each sub-sub cluster.
    I just wanted to use one "Main Cluster":Mouse Down event and from that determine which of the sub-sub clusters had been clicked on - is this even remotely possible?
    Chris.
    Yes but... you will have to pass through 26 Kudos worth of Nuggets to get there (Well maybe you can skip the last 5 or so).
    This Nugget by Ton teaches us how to use Dynamic Event Registration. (15 Kudos, must read and understand)
    This Nugget by me talks about getting at references inside arbitrary data structures. (11 Kudos, You don't have to read the whole thing, only enough to get at nested objects).
    SO use the stuff I wrote about to gather up the references to the clusters. Build them into an array and then use dynamic event registration and what you learned in that thread you linked in your question.
    So Possible? Yes!
    Easy? YOU tell me.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for