How does deadlocking happen when not updating UI on swing thread?

It looks like the 2 objects that cause the deadlock are the RepaintManager and the JComponent.LOCK object...but I can't really find a scenario where this happens in the code.
Can anybody shed some light on this?

Basic rule of thumb:
If you can't guarantee that your code will run on the AWT-Event thread then wrap your calls in a SwingUtilities.invokeLater() call (or its cousin invokeAndWait()).
Basically this looks like:
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// put your gui updating code here
There are two ways to make something thread safe:
1) Guarantee calls will always come from the same thread
2) Synchronized shared objects.
Swing chose choice 1 since choice 2 would be two big of a performance hit. The thread it uses is the AWT-Event thread. The invokeLater call tosses your Runnable object at the end of the Event Queue. The AWT-Event thread pops a Runnable off the Event Queue processes it and then repeats.
As to specifically whats happening, I can't say without more information. Really you should go back and make sure all your Swing calls are on the AWT-Event thread. That should solve your current problem and prevent future problems.

Similar Messages

  • I brought a iphone 4 today and it was locked to orange network my orange sim worked n it i could revieve an make call but today i went to a shop to get it unlocked and they told me it was blocked in the uk how does this happen when i already used it?

    i brought a iphone and it worked perfectly i used it for like a year but i got a new sim so i had to get it unlocked but when i did they said the phone is blocked in the uk how does this work when i had already used it??help

    I'm sorry but I don't have an answer for you... But I do have a couple of questions that may help others to help you! Was it necessary for you to get a new sim? I'm guessing yes or you would not have done that. You might want to try calling Orange and asking them to unlock it, they might ask you to connect it to your PC and use ITunes with it. Tunes will then say Congrats! Your IPhone Is UNLOCKED! I did this in the US with an OLD iPhone 3 first they asked me a serial number and other info and it worked like a charm. But the thing is Orange [or Apple] must be satisfied that the phone's contract obligations have been fulfilled. I know this is complicated and a pain in the butt, but if it's a dead phone now I would give it a shot. Oh BTW I believe here in the US it's no longer against the law to unlock a phone, apparently the law was changed, not sure about this though... Good luck!

  • How does one get past not updating on a 2nd generation iPod touch?

    My iPod touch 2nd gen. is stuck on the iOS 4.2.1 update and I'm just wondering if there's some way to get past this so I can get higher updates?
    I know it's not supposed to but is there anything I can do?

    "My iPod touch 2nd gen. is stuck on the iOS 4.2.1 update "
    That is correct.
    "I'm just wondering if there's some way to get past this so I can get higher updates?"
    no.
    "I know it's not supposed to but is there anything I can do?:"
    Still no.

  • HT5616 I have an apple id; but when I try to sign in to iCloud, I get the msg that the apple id is not an iCloud account.  However, apple was able to bill me for my non-existent iCloud account.  How does that happen?

    I have an apple id; but when I try to sign in to iCloud, I get the msg that the apple id is not an iCloud account.  However, apple was able to bill me for my non-existent iCloud account.  How does that happen?

    If you didn't create an iCloud account on an iOS device or Mac, you don't have one.  You can't create an account on a PC.  If you were charged for an iCloud storage upgrade without having an account, contact the Apple online store at the bottom of this page for a refund.

  • How does this happen: The picture of recent apps you get when double clicking the home button showed in Settings-Wifi that I had been connected to a network I have not been near for two months. Its not a recent "image" of Settings-Wifi. Can anyone explain

    How does this happen: The picture of recent apps you get when double clicking the home button showed in Settings-Wifi that I had been connected to a network I have not been near for two months. Its not a recent "image" of Settings-Wifi. Can anyone explain?

    Greetings,
    I've never seen this issue, and I handle many iPads, of all versions. WiFi issues are generally local to the WiFi router - they are not all of the same quality, range, immunity to interference, etc. You have distance, building construction, and the biggie - interference.
    At home, I use Apple routers, and have no issues with any of my WiFi enabled devices, computers, mobile devices, etc - even the lowly PeeCees. I have locations where I have Juniper Networks, as well as Aruba, and a few Netgears - all of them work as they should.
    The cheaper routers, Linksys, D-Link, Seimens home units, and many other no name devices have caused issues of various kinds, and even connectivity.
    I have no idea what Starbucks uses, but I always have a good connection, and I go there nearly every morning and get some work done, as well as play.
    You could try changing channels, 2.4 to 5 Gigs, changing locations of the router. I have had to do all of these at one time or another over the many years that I have been a Network Engineer.
    Good Luck - Cheers,
    M.

  • Iphone 4 does not open any application it happened when i updated my iphone4 in my mac book pro

    iphone 4 does not open any application it happened when i updated my iphone4 in my mac book pro

    Install a free app. Click App Store app, find any free app you might like, install the app. If still problems, try a Reset, hold both Home and Power buttons until the iPhone restarts.

  • I was using my notes earlier today and now for some reason they are all gone. How does this happen and is there anything I can do to get them back, the new ones also that haven't been synced.

    I was using my notes earlier today and now for some reason they are all gone. How does this happen and is there anything I can do to get them back, the new ones also that haven't been synced.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • In Mac Mail on OS 10.5.8 I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.  How does this happen and how can I correct this problem

    n Mac Mail on OS 10.5.8 I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.  How does this happen and how can I correct this problem

    You said:
    I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.
    ...and:
    Are you saying that my address book has not been hacked into?  That others are getting these email addresses from another source?
    This confuses me.  Are you saying that you are receiving bogus e-mails from some of your contacts, or are you saying that they are receiving bogus e-mails from you?
    If the latter, there are a number of reasons that people might be getting e-mail from you.  Malware, though technically possible, is extremely unlikely.  See Someone is sending messages from my e-mail address!
    If the former, that's rather unusual.  The only decent explanation I can think of is that a bunch of your Windows-using contacts got infected with something and their machines are being used to spam everyone in their contact lists, which would include you.

  • I updated to ios8 and tried to use Health Application. In Sources I get a message that other applications will show up on the list as they request permission to update your data. How does it happen? No apps are listed on my Sources section

    I updated to ios8 and tried to use Health Application. In Sources I get a message that other applications will show up on the list as they request permission to update your data. How does it happen? No apps are listed on my Sources section

    I have an answer to my question. There is a bug in IOS8 that prevents third party applications to talk to the Health Application. Apple is trying to fix it ASAP

  • TS3367 I was trying to contact my wife in another country on a trip as I have several times since she has been away. Today we connected and then lost the signal and when I tried her again I got connected to someone in CA. How does that happen??

    I was trying to contact my wife in another country on a trip as I have several times since she has been away. Today we connected and then lost the signal and when I tried her again I got connected to someone in CA. How does that happen??

    Edge has very clear restrictions, one being that you must have 6 months of clean payment history which you don't. Either wait until April 14, or good luck at Sprint.
    I am unsure how it can be determined the payment mix up was the fault of CS, but regardless, the mix up was done. There can be any number of reasons why a payment could be missed without any fault on your part, however you are still the responsible party for the account and must live with the repercussions.

  • How does BerkeleyDB know when cached results from stat function are valid ?

    Something curious: I have a berkeley database about 2G in size and a program that (1) opens the database, not DB_RDONLY; (2) calls stat(), without DB_FAST_STAT; (3) calls sync(); (4) calls close().
    Running this program the first time takes a good amount of time in the stat() function - 20 minutes at least - and thrashes the disk all that time. So it's trawling the database to get record counts etc.
    Running the program again takes only a few seconds so clearly the database is caching those stats and knows they're up to date - makes sense.
    What's odd though is why the stats weren't known to be up to date on the first run. The database was actually copied from another box where the last thing to happen was a run of the same program. So it should have had up-to-date stats cached in it.
    It's as if the cached values are somehow invalidated by moving the database to another machine. Why would that happen ? Where are the cached stats held and how does berekelyDB decide when they're up to date ?

    I still cannot solve this problem, but I have some more observations:
    1) yes it is a JApplet, and yes, the data streaming is performed in a separate thread.
    2) Wireshark sniffing shows that data sent out by the PHP datasource on the server is sent immediately, and is not buffered (am using ob_start(), ob_flush() and flush() alls in the PHP script).
    3) On Windows Vista, using Internet Explorer or Firefox, there is a constant 30 second delay before the Applet returns from this line: InputStream is = url.openStream();
    4) After this 30 seconds, data appears in the Applet, but it can be seen also with java console debug prints that the data seems to be buffered. The newest data shown in the Applet is not the newest data sent to the client by the PHP datasource script.
    5) On a SUSE Linux client, the Applet works as it should, there is no delay time in showing the data.
    It appears as if there is on Windows a buffering of data which I do not wish to have and which does not occur on Linux. I need to find out how to get the URL openStream() call to return immediately allowing the initial data to be read and shown on the Applet. And I need to remove the buffering of data so that the data can be shown on the Applet when it arrives.
    Can anyone help? Why does this work on Linux but not on Windows, and what can I do, at best within the Java code, to get the Applet to work on Windows as it does on Linux?
    Thanks!
    Steve, Denmark

  • How does the MDKP table gets updates

    Dear PP Guru's,
    I am new to SAP PP,
    We have a query that how does the MDKP table gets updates,
    Some time If we create new material by coping the material which is showing in table MDKP,
    But new material is not showing in table MDKP,
    Based on table MDKP we are fetching some data, due to above problem we are not able to fetch the data for some materials,
    Please suggest what could be the reason,
    Any help will be highly appreciated,
    Thanks in advance,
    Sachin.

    Thanks Thaila,
    I have checked the same by doing MRP through MD02 & the entry is getting update in MDKP,
    But for some of our materials MRP (MD02) is done earlier, but these materials are not showing in MDKP,
    Please suggest, when the entries in MDKP are removed, are there any conditions for removing the entries from MDKP.
    please pour some light on the issue,
    Thanks once again,
    Sachin.

  • TS1702 The application "video converter" says that I can retrieve my converted files through iTunes.   Where and how does that happen?

    The application "video converter" says that I can retrieve my converted files through iTunes.   Where and how does that happen?

    I see an iPhone App called Video Converter but not an iPad app. When to do a search, it comes up with a whole bunch of apps so perhaps if you tell us exactly which app it is .....

  • Under search in maps, names come up that aren't in my contacts. How does this happen?

    Under search history in the Maps app,...along with all the other places I
    did search for, some addresses comes up that I'm not familiar with, and they stay
    there. In some cases I didn't search for them at all. Some I may have. A name also
    appears, under the address, like "from John Doe". It’s a name that
    I'm familiar with my email, but is not in my contacts. Why and how does
    this happen?
    For example, a person I receive emails from for work, came up as the
    "from", and the address, after I searched for it (not on my phone).....I found out
    it was the address of his company, I place I've never searched for, nor is
    there a hyper-link to it any emails/websites that I could have clicked on
    accidentally.
    In another example, the beginning of an address “5165” which I may have searched
    for and starting typing in came up in the history with several locations that
    start with those numbers. Most of them say “from current location”, but one says from
    a name, whom again I’m familiar with by email, but is not in my contacts and
    have no idea of why the name would be somehow connected to the address.

    Thank you for the reply. I really appreciate it. Do you know why the names are attached, as "from"?
    I attached a screen shot image. "Harry" and "Angela" are not contacts in my phone. Who would their names get there?

  • Is apple going to fix the magic trackpad issue with Autocad zoom/pan soon? It only started happening when I updated to Yosemite

    is apple going to fix the magic trackpad issue with Autocad zoom/pan soon?
    It only started happening when I updated to Yosemite
    I am using macbook pro 15" Retina

    Although it not only bothers me but alot of other photo booth users aswell

Maybe you are looking for