How do you recognize JLabel pictures when using mouseListener

Im doing a project where im making parcheesi. for this project im using mouseListener and JLabel images on top of JPanel squares. I need to be able to be able to recognize each color in order to either move the image or to create a new one. Any pointers on how to do this?

It sounds like you're starting your game with the GUI. It's generally a better idea to get the actual workings of the game out of the way first and worry about the GUI last. A command line parcheesi game might not be pretty, but it's probably best to program your GUI independently of game function.
For example, store the parcheesi board in a 2D array (or something of the sort) of chars. Then you can have a function the draws the board based on that array. Clicking and dragging would also use that array to paint the appropriate pieces. But like I said, that should be your last step.
That's just me though. People tend to rush into the GUI part of a program, even after advised to do otherwise.

Similar Messages

  • How do you change the picture when logging in

    I want to change the picture / Icon when I log in.  How do I do that?

    Changing your user account icon
    Your user account icon appears in the Login window when you log in (if your Mac isn't set to automatically log you in), and is used as your contact portrait unless you change it. When you first set up your user account, you have the opportunity to select a picture to use as your icon. You can also change the icon whenever you want, as described below.
    You can use one of the included icons, drag in a custom image, or take a snapshot with your Mac's camera
    From the Apple menu, choose System Preferences.
    Click Users & Groups (click Accounts in Mac OS X v10.6).
    To the left of the "Change Password" button is a pop-up menu that shows your current account icon. Click it to choose a different icon, or to use your Mac's camera to take a snapshot to use as an icon. You can also simply drag a picture to the menu
    If desired, crop and reposition the new icon.
    When satisfied, click Done to make the change.
    http://support.apple.com/kb/ht2493

  • How do you *unset*  Content-Type when using HttpURLConnection ?

    Hi people,
    I am using HttpURLConnection to set some http headers. It all works fine except that this utility is setting Content-type to text/html even though I cam not coding it to do so. I can overwrite Content-type by setting it to say, a blank, explicitly in the code, but Content-type still appears as a header (eg if I view the headers in a proxy.)
    My question is - how do you completely unset Content-Type? Here's the code snippet :
    URL url = new URL("http://mymachine-uk.uk.company.com:24331/test.html");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setIfModifiedSince(longdate); // I've set up longdate previously
    // set some headers
    con.setRequestProperty("Cache-Control","max-age=0");
    con.setRequestProperty("User-Agent","Mozilla/5.0");
    con.setRequestProperty("Keep-Alive","300");
    // I've tried hacking it like this :
    // con.setRequestProperty("Content-type",null);
    // but that just shows an empty Content-type, rather than get rid of it.
    // In a proxy window on port 24331, the three headers set explicitly above
    // all show up correctly. But Content-type:text/html is also shown, even though not coded.
    // If I fire off the same page request from a browser, Content-type ISN'T set.
    // so there must be a way of doing it :-) Help!
    thanks.
    Edited by: colin_the_aardvark on Feb 24, 2010 1:45 AM

    Hi there,
    thanks very much for trying this, the background to this is as follows :
    I am testing a software server caching product which is giving me weird behaviour; the actions the cache performs are supposed to be based on the various http headers. I am using a debug proxy ("Charles") (limited freeware-for-a-short-period) to see exactly what http headers are being set by the calling browser, or in this case, the java program. I am setting the headers directly in the code above to match what my browser is setting, as revealed by Charles. Trouble is, I'm getting different reponses back: The browser gets a http 304 from the cache and my java program gets a 200, so I have obviously failed to emulate the browser.. and the only difference I can see is that the Conetnt-Type is not set when I call the page from internet explorer, but with my program above, Content-Type is set, to a default of text/html. I want to get rid of it so I have copied the browser http header settings 100%.
    - I tried compiling this code and running it from the prompt (outside of development environment) and Content-Type is still showing up. So from what you are saying... if your attempt does not set this.. then it looks like Content-type must be getting set via some other means?
    thankyou :-)

  • How do you turn off sounds when using phone?

    I know this question is not appropriate for this forum but I cannot find where it should go. I want to turn off the sounds when I am using my phone, e.g., when I am texting, each time I press a key it make a sound. If I turn down the volume then I cannot hear it ring so this is not the answer.
    I have the Nokia 7020 phone. I cannot find any help in the userguide, only how to change ring tones. Anyone have any idea? Thank you.
    Solved!
    Go to Solution.

    On my Lumia 900, it's under Settings -> ringtones+sounds, scroll to the bottom where there is a list of check boxes, and uncheck "Key press".  Not sure it's the same for your phone, though.

  • How can you Keep column links when using export CVS

    I am exporting a report using Report Template of export: CVS. This report is a copy of a report that have column links that work. However, when I export the report using export: CVS the excel file no longer has the links in the columns.
    How can I get the link to be transferred to excel?
    Thanks

    446336,
    When you export anything as CSV type it is a plain ordinary text file - MS Excel opens it because it has knowledge of this type of file (ie text delimited by comma/tab).
    You seem to need a bit more than that - best if you search the forum for ¨excel¨ or maybe ¨report exports¨. I believe there are some threads here that may help - I think it needs java or some fancy PL/SQL to do it.
    Greg

  • Pre - How do you silence external ringer when using headphones?

    When I get a call while using the headphones, I'd like to hear the ringer in my headphones only... Currently when I get a call it rings in the headphones AND via the external speaker. So let's say Im sitting in church listening to music on my phone :-)... and I happen to get a call, instead of me just hearing the call in my headphones, the entire church gets to hear my phone ring as well...
    I have tried silencing the phone but that silences the ringer in the headphones as well.
    It seems like I could do this on the first phone I had (I took my first pre back for various other reasons)... but for whatever reason I cannot seem to make it work on the new phone. Maybe Im just not setting the preferences correctly... Any suggestions?
    Post relates to: Pre p100eww (Sprint)

    You can use GP. Search the administrative templates for Prevent Running First Run Wizard
    If my answer helped you, check out my blog:
    DeployHappiness. Subscribe by
    RSS or
    email. 

  • How can you see the progress when using a ForEach loop?

    Hi,
    I have an array with about 100 containers in it. My main thread uses a ForEach loop with an inner case structure with six possibilities. My previous program had all the steps in a very long list, executing them one by one. I find this new approach is much nicer to look at, and easier to change, but there isn't really any way of telling how far along the test is (unless you know it by heart). In the long list approach, you could see all the Done/Passed outcomes and how many remained, now there is no way of telling.
    Any tips on making some kind of progress indication? 
    Solved!
    Go to Solution.

    As ObjectReference parameter, you should use 'Nothing'. The last parameter (synchronuous?) you can choose true or false. Please refer to the documentation of PostUIMessageEx for further information.
    The numeric parameter should range between 0-100. Since it is "Progress Percent", this makes sense, does it?
    The status bar has several panes, one e.g. displaying the logged in user or the used process model. The pane on the right most side will display the Progress Percent if used in your sequence.
    The default reporting, as already stated, includes this feature. So if you have a sequence with e.g. 500 steps, the reporting "will have a visible progress" in that pane (with less than 100 steps, it is most often too fast to see). Remember that NI Sequence Editor and the Full Featured User Interfaces do have this feature, the Simple UI does not have it.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How do you disconnect Publish site when using a test copy of the website?

    To sort out a solution for accessibility, I made a copy of the live Muse file called "Testing" and did my experiements on this. However, how can i disconnect this copy from the live website as I might click Publish accidentally not realsing I am in the testing site and it will synchronise with the live site (which it also tries to do when I open the "testing" Muse file as in the meanwhile changes have been made to the live site). In other words, I want Muse to treat this copy as a new site, not a variation of the live one but I can't find anyway of doing this inside Muse?

    Publish the test site to a new trial BC site (meant for testing) so the next time you hit the Publish button accidentally, it connects to this newly created test website.
    Thanks,
    Vinayak

  • How do you change the picture size using airplay? The image is small

    Using the mirror feature,  the image is not filling up the screen on a 48" 1080p TV any ideas?
    Thanks in advance..

    Mirroring won't fill the TV screen. The iPad has an aspect ratio of 4:3 and the iPhone 4S or prior an aspect ratio of 3:2, neither of these will fit exactly into a TV screen which as an aspect ratio of 16:9. The Apple TV will not zoom the mirrored image, because it may well cut off information which is situated at the top or bottom of the screen.
    You may wish to try each of the settings in settings > AirPlay > Adjust for Overscan for the best setting that suits you.

  • How do you enable isight camera when using MSN?

    Or isn't it possible? My kids also tell me MSN + is a lot better, but that doesn't appear to be available for mac. I read somewhere you can link ichat to MSN using something called Jabber. Any ideas anyone?
    Thanks

    I use SightSpeed for use with my uncool Windows friends:
    http://www.sightspeed.com/personal
    It is free and easy to work with, both parties need to have it on their computers. In my experience everything is a pale second to iChat, I have tried them all. Loving iChat!
    SZ

  • Pse 11: How do you transfer a picture into a puzzle when using PSE 11?

    How do you transfer a picture into a puzzle when using PSE 11?

    Hello,
    because I work with PS CC I will give you some links, the first program is expressly made for PSE 11:
    PSE11: http://www.panosfx.com/commercial-free-photoshop-actions/puzzle-effects
    Here a Adobe Plugin:
    Adobe - Photoshop : For Windows : Photoshop CS5 Optional Plugins
    These links here may act as examples and maybe you cane use them too
    Create Jigsaw Puzzle Effect for Photos - Photoshop Tutorials - CSSCreme.com
    http://www.avbros.com/puzzlepro/index.html
    https://creative.adobe.com/addons/products/1069#.U_dkQ2NQQs0
    http://www.photoshopessentials.com/photo-effects/photoshop-puzzle/
    http://www.obsidiandawn.com/jigsaw-puzzle-pieces-photoshop-gimp-brushes
    Good luck!
    Hans-Günter

  • How can you keep your iPhone 4 (using it as my car's iPod) staying on the Audible app?  When I leave the car and return to continue hearing a book, it has switched to iTunes.

    How can you keep your iPhone 4 (using it as my car's iPod) staying on the Audible app?  When I leave the car and return to continue hearing a book, it has switched to iTunes.

    The first time an iPhone is connected to iTunes that is used to sync with another iPhone or iOS device, you are prompted to transfer the backup for the other iPhone or iOS device or to set up the iPhone as a new iPhone.
    The former does as provided - it transfers the backup for the other iPhone or iOS device to the iPhone replacing all data on the iPhone that is included with the backup being transferred. The latter does nothing allowing you to make your various selections for the iPhone sync preferences with iTunes.
    This is designed to be done right away with a new iPhone.
    If you don't have a backup for the iPhone with iTunes on your computer and don't have an iCloud backup that hasn't been updated since choosing to transfer the backup for your iPod Touch to the iPhone, the data that was on the iPhone is gone.

  • Iphone 3GS- How do you get the pictures to show up larger when someone call

    Iphone 3GS- How do you get the pictures to show up larger when someone calls? I know this seems trivial but I have difficulty seeing, so one of the reasons I actually purchased this phone was for this feature. When the photos do come up they come up in the top right corner in small boxes / windows. I already google'd this topic and they suggested importing the photos - to itunes and than directly on to the iphone, I did this and it didn't work. Additionally I took a few test photos from the iphone and tried setting them to contacts. This didnt work either. I looked in settings and could not find anything that discussed this issue. Although I do believe I have seen iphones that ring with large pictures. Am i Crazy?

    You aren't crazy.
    Adding the photo to contacts on the computer gets you the smaller pix when people call.
    Assign the photo on the phone itself and you get full-size pix.
    Additionally I took a few test photos from the iphone and tried setting them to contacts. This didnt work either.
    So, that certainly should work. Try it again? Try it with a brand new contact, maybe it is not overwriting a previously existing picture.
    I suppose there is a small possibility that Apple thought this differing behavior was a bug instead of a feature and "fixed" it with a recent update, but I doubt it.

  • How can you tell what pictures from iPhoto you already used in iMovie?

    how can you tell what pictures from iPhoto you already used in iMovie?

    Log into your account on a computer (iTunes>Store>View Account) and go to Purchase History

  • HT3771 how do you delete printer in last use when you try to add new printer again

    how do you delete printer in last use when you try to add new printer again?

    System Preferences > Print & Scan (Print & Fax on older versions of OS X)
    Select the printer and click the "–" (minus) button.

Maybe you are looking for

  • Mini DisplayPort to HDMI Adapter... no audio

    i just purchased a Mini DisplayPort to HDMI Adapter for my MacBook Pro 2012 and have connected to my TV. I have video, but no audio. Does anyone know how to get the audio to work?

  • Airport Express Ethernet

    I have an Airport Express and I have used it as a extension from my Airport Extreme. I have brought it into work today to create a wireless signal via an ethernet cable but the light is flashing orange and is sending out no signal. Do I have to re-co

  • ABAP - CASE STATEMENT - How to get out of WHEN statement??

    Hi ABAP experts, I am implementing an User exit related to inbound Sales order. All my IDoc contain,  E1EDP02 001                                E1EDP02 002 segments. Case w_e1edp02-qualf. when '001' clear lv-tabix. lv-tabix = sy-tabix + 1. Read int_

  • Make imported jpg in Ai CS5 have transparent background instead of white

    I have been looking around the forums and help pages, but I can not seem to find my answer.  Maybe I am using the wrong terminology? In Adobe Illustrator CS5 I have imported a jpg into my artboard.  The jpg has a white background.  I would like to ma

  • How can I add new lumetri looks to Premiere Pro 2014?

    I just downloaded some great new Lumetri looks, created for SpeedGrade, which I'm currently not using [much]. Since Premiere Pro now comes with a default set of Lumetri looks in the Effects panel, how would I go about importing these new effects for