Help! Swing freezes

Hello,
I developed several applications using Java V1.4.0. All apps were running at its best. Now I switched over to Java V1.4.1 and all Apps using Swing components (especially JList, JButton, JTextArea, ...) are freezing now.
In Detail: I have an App which I use to administrate a database. I use the CardLayout to switch between the login panel and all other panels. When I start the app the login panel is shown. I enter the login data and hit the login button. Now there are many ways that can happen:
Way 1: the button freezes but the app is still alive (the background threads which don't use Swing are still alice)
Way 2: I have some processing but when the app wants to switch to the other panel Swing freezes (again, all background threads are still alive).
The best thing is the server app I wrote. I can start the server but then immediately (OK, when I want to write some debug data to a JTextArea) Swing is freezing. Now I connect to the server app via some client apps and they are working perfect.
I tried to debug the apps a little bit. Anytime Swing freezes the call stack shows that javax.swing.RepaintManager.addDirtyRegion is the last thing that executes something (or is still executing? forever??). Does Sun has changed something in that class?
I use Linux (SuSE 8.0), Athlon TB 1.1G, Geforce 2 MX. Does it happen to anyone else?
Best regards
DirkBW

Hi!
I have the same problem. It seems that this happens if you instanciate a JComponent in the EventDispatchThread. Try to generate your Swing-Components in a seperate Thread and it will work fine. I think there's a another monitor-lock on the Repaint-Manager in the EventDispatchThread. So if you go into the addDirtyRegions - Method the JVM blocks the EventDispatchThread until the monitor-lock is released. But the EventDispatchThread is the only one who can release this lock -> deadlock. Your Applicaton is working fine after that, only Swing has locked itself. :-(
But it's not very easy to build all JComponents in a seperate Thread. I think it's a serious problem. Maybe bug-report-worthy?
Steve

Similar Messages

  • Please help keep freezing

    hi.. i just buy my first blackberry curve 8530 and the trackpad keeps freezing,not let me do anything ,
    i  should return it to the store? repeatedly remove the battery when is on, is  that more I can do , I am thinking of returning it.. . Please any help

    I am having this same problem and I have NO idea what is causing it. I have been searching high and low for an answer, and nothing seems to be appearing. The only thing I could think now is to maybe re-install Firefox. That is the browser I have been using and that this has happened in.

  • Please help - Ipod freezes when playing any video

    Hi
    I only got my ipod video a day ago and it wont play any video files. Everytime i go to play a video it freezes and just shows a black screen. I have tried downloading a music video from the itunes store and this wont work either. When i first got it i did play one video, im not sure if this was before i updated the firmware though?
    I cannot figure out how to reset the firmware if this is what i need to do?
    I would really appreciate some advice.
    Thanks in advance.

    I just got my iPod like two months ago and it wouldn't play any video podcast until I downloaded the new iTunes software. Now it plays some video podcasts but not all. I tried to watch some new podcasts I had downloaded from iTunes and it would play some of it then just freeze and make these wierd sounds. I tried again and it totally froze where I couldn't do anything, not even turn it off. It stayed that way until the battery was completely drained then it turned itself off later that night. The next morning I charged it up and it worked fine but I still can't watch those podcasts. Please help, cause this thing is pretty much brand new and for the amount of money I spent on it I don't want it to start giving me problems after only two months.

  • Problem Please Help - Itunes freezes when trying to play a tv show/movie

    The other day I downloaded a couple movies I had rented. Something I had not done before on itunes. The three movies downloaded with no problems and then when I was on my flight I tried to start one of them. Itunes went black as if to start playing and then froze. I disregarded it at the time thinking it was just my computer being buggy. Which was odd because I hadn't an issue with itunes really. However since those downloads I cannot play anything I downloaded. The moment I try Itunes goes black as if to play and just freezes. I have now lost money in this because I was unable to watch that one rental, and am now trying to watch tv series that have already paid for but am having no luck. So what do I do? I've reinstalled several times, I've tried the little fixes that they suggest online but nothing is working! Also if you can tell me how to contact someone that would be a great help too because this just isn't working.

    I have the same problem. I  purchased several episodes of a television program and they will not play either in iTunes or in Quicktime without stuttering, jerky video, choppy audio, and the video and audio being out of sync. As a new iTunes user, this experience has completely soured me and unless I find a solution.
    I have absolutely no problem with playing video from any other source through any other player. I can stream videos fine from Amazon, YouTube, and everything in between, and videos downloaded from Amazon and elsewhere play just fine whether I'm using VLC, RealPlayer, or WMP. DVDs also play with absolutely no trouble whatsoever. It is only iTunes videos that have any trouble.
    I have already consulted the page that was suggested here (and on other threads I've read), and nothing on that page was useful. (Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/TS1718)
    This is extremely frustrating. I have Win7 Premium with 4 GB RAM and an AMD dual core 1.65 GHz processor. It may not be the ultimate gaming machine, but it's performed really well up until it encountered iTunes.
    I also tried using QuickTime, thinking that might work better, so I downloaded the most up-to-date version, and playback was marginally better but still unwatchable.
    Considering that this is paid content, it is unacceptable that it cannot be played on my computer -- and I have watched trailers for the episodes on YouTube (it's newly released), and they play perfectly, so I know it's not the episodes themselves.
    Is there a codec that I should install? Is there any fix at all for this issue?
    It seems that a large number of people experience this, which means that a lot of people are paying for something and then getting nothing -- and it's not a problem that can be discovered before the content is purchased. This is a very frustrating situation!

  • NEED HELP ITUNES FREEZES WHEN OPENED PLEASE HELP

    hello all
    whenever i open itunes on my macbook, the loading pinwheel comes up and doesn't go away until i quit itunes or turn off my computer. my itunes will 'freeze' whenever i open it and will not let me play songs or anything. please help me!

    There are a lot of things that could cause this and your songs are rarely in jeopardy when the issue is iTunes so don't worry.
    If you could give us your iTunes version number, and the OS version you currently have those would help narrow a little.
    Did you install or change anything around the time that this started happening?
    Also explain exactly what happens. does the itunes window open than hangs with pinwheel or does the application bounce like it's going to open then hang instead.
    I would, even if just for good maintenance, repair permissions by going to your utilities folder opening Disc Utility selecting your HD from the left and clicking verify disc permissions. Also make a new user to test to see if iTunes opens there, if it works in a new user it's an issue with one of your user specific files, and there would be much less to sort through.
    More info will help a lot in figuring out whats going on.

  • Help: iTunes freezes when I try to change the music folder location

    Hi everyone,
    I want to change my iTunes music folder location but every time I click on the change button (Edit > Preferences > Advanced > Change) iTunes freezes. All of my music is in an external drive and I recently reinstalled windows, so I had to back up the old iTunes folder and replace the default one (after the reinstallation) with it, but now I can't set the new location of the drive because of this problem.
    Any help or ideas would be greatly appreciated
    A.

    Okay. Finally called Apple, and they said that this is something to do with the latest iTunes - 10.6 - and the only way to solve it is to restore my iPod, and then arrange it so I manually manage my music, etc. Which I learned how to do here: http://en.kioskea.net/faq/3740-how-to-manually-manage-music-and-videos-in-itunes  It worked. Woo-hoo!

  • Help: Windows freezes and iPod empty

    Last night (UK) I posted a message considering the problem that My Computer, iTunes and iPod Updater don't recognise my iPod ANYMORE (so it did before).
    Now, even worse, when I plug in my iPod Windows XP freezes. My iPod cannot be properly disconnected. When I do so, the iPod gets stuck on "don't disconnect." It takes a long time, before the iPod recognises it's not longer connected to the computer and it loads Menu. However, every file on it is gone (and I cant reload or update it, since my PCI doesnt recognised it anymore).
    Strangely, my iPod Info says that there is just about 20 gig of free space in it. Although there are no files on it anymore.
    So what is failing: my computer or my iPod???
    Any help welcome!

    Since the iPod seems to be recognised on other comps then it does sould as if the problem is with the comp rather than the iPod itself.
    Make sure the iPod is fully charged before you start.
    Try creating a new user account on the comp which won't recognise the iPod and use that account.
    Go through the apple 5R's, be sure to uninstall iTunes and the iPod software with the iPod disconnected from the comp and when you reinstall do so with the iPod disconnected and only connect the iPod when the software prompts you to do so or after the install has completed. You might like to reboot the PC after you've uninstalled the iTunes and iPod software and reboot again after you've completed the reinstall. Follow apple's instructions to the letter.
    If you still don't get it to work you will need to consider reinstalling XP and starting over with a clean install.
    Hope that helps.

  • Please help : Probleme freeze Adobe Média Encoder CS 4 with 720P YUV setting

    I work on editing movie : YUV 1280/720p 25i 48khz 16bits... (24 minutes - 68go)
    lastest versions of premiere pro - media encoder - after effect on my pc (quadcore, 4Go, 4x1T hardrives)
    Work on Vista SP1 SP2
    Media encoder always freeze. When i clicking starting queue... I can't export movie.I try on several stations.. Same problem. I try on several projects...same problem...
    Somebody can help me ?
    I have the same probleme everytime.
    Premiere pro play the movie very well , not problem... but after that always média encoder... freezing...
    If someone can help me please.

    i reinstall, nothing change..
    i try to close caption the movie adding titles on master...i try to export..
    same problem...
    Just a bit crazy
    Manuel Liminiana
    Mac Guffin Production
    www.mac-guffin.net - [email protected]
    06 75 38 21 43
    Centre Factory
    www.ecole-factory.fr - [email protected]
    04 37 48 00 21
    2009/10/31 Jim Simon <[email protected]>
    Yeah, that seems like a freeze.
    >

  • Help - DVD freezes halfway through movie!

    I've tried burning something that is 1hr and 32 minutes long... but both times I've burned it, it freezes sometime during the 47 minute mark. When I say it freezes, I mean when it's finished burning, and I try it in a DVD player, it starts freezing as if it were scratched. The DVD had no scratches both times...
    I've tried:
    Making more space on my computer.
    Closing all other programs and not touching the computer as it's burning.
    Perhaps I need to make some chapters? As of right now, I've only burned the movie as one, bulk movie that you have to fast-forward through.
    Any ideas?
    - bahardesty

    Hi
    1. iDVD 8 has three levels of qualities.
    • Professional Quality (movies up to 120 min.) - BEST (iDVD08 only)
    • Best Performances (movies less than 60 min.) - High quality on final DVD
    • High/Best Quality (movies up to 120 min.) - slightly lower quality than above
    2. From
    • FCE/P - Export out as full quality QuickTime.mov
    (not selfcontained)
    (not with QT conversions)
    • iMovie x-6 - Don't use ”Share/Export to iDVD” = destructive even to the movie project and especially so
    when the movie includes photos. Instead just drop or import the iMovie movie project icon (with a Star on it) into iDVD theme window.
    • iMovie’08 not meant to go to iDVD. Use iMovie HD 6 (need to b e publiched into the
    media manager.
    3. I use Toast™ to make an as slow burn as possibly eg x1 (in iDVD’08 this can also be set)
    4. There has to be about or more than 25Gb free space on internal (start-up) hard disk. iDVD can't
    use an external one as scratch disk (if it is not start-up disc).
    5. Verbatim ( also recommended by many - Taiyo Yuden DVDs - I can’t get hold of it to test )
    6. DVD-R (no +R or +/-RW)
    7. Keep NTSC to NTSC - or - PAL to PAL when going from iMovie to iDVD
    8. iMovie 6 has a bug: if You emptie the trash in iMovie ken burns might stop to wirk and photos has to be re-imported and re-done.
    Note from - elkriverken: With the help of others, I was able to narrow down the problem. However the final solution was to keep all the audio confined to only ONE track. When I added audio on the second tract overlapping the first tract audio, the noise or flutter began and continued past the ending of the audio from the second tract. Now there is no flutter. The video and audio now work perfectly. Thanks to all.
    Yours Bengt W

  • Need help with freezing...please respond!

    I just got my reconditioned ipod mini yesterday. The problem is that at the main menu the scrolling mechanism works (thumb rotation), but the select button does not (I can't get into any submenus). I called Apple support, and they said to reset. I did this; the mini worked OK once, but then started to freeze up again, and now, no matter how many times I reset, it doesn't help...I'm stuck at the main screen, and the select button won't do anything. The apple support guy says he has to reset his mini 2-3x a week, but I've been able to make my ipod work only once or twice, and I've had it a day. PLEASE HELP.

    I keep trying that too...doesn't seem to help. Have tried plugging it into the AC adapter and resetting; doensn't help. Updated my ipod/itunes software; doesn't help. I don't want to try restarting the ipod; I just spent 6 hours putting music on itunes today, and don't know how to create a backup...and I read the restart instructions and don't know how to do all of the steps. Its amazing to me that this unit works so poorly literally the first day out of the box. How disappointing.

  • Mac Help and Freezing

    Hello, I had some trouble with Mac Help yesterday - as in it's gone! - and I've tried the troubleshooting tips, but still no Mac Help. I don't know if probable cause is constant freezing over the last two days? Today is better (hence I can type), but I guess it is only a matter of time. The computer only freezes when plugged in and hooked up to internet, no problems when on battery (don't have Airport at home). Need Mac Help for help - but it isn't there and system keeps freezing in safari and discussions. Please, please some info?!?!?

    The fact it is only freezing when you are plugged in
    and hooked up to the internet says something about
    how you are hooked up to the internet may be at
    issue. What method of internet connection do you
    have? Is it a standard telephone line, an ethernet
    or USB modem?
    Also have you backed up your data? Some
    troubleshooting steps may require risky operations to
    the hard disk, so we want to make sure you are backed
    up first before we proceed.
    Hi, and thanks for the reply. I haven't been able to respond, because - of course - every time I do the Mac freezes halfway through my message.
    I have a modem and broadband at home, although I have recently purchased an Airport Card, which I haven't used yet. The problem is that I am going abroad for three months on Saturday (which is why I bought the card to access the school's WiFi where I'm going), and I doubt I'll be able to do much before then.
    I only really have iTunes on it that I might not be able to get back. Although I have iPod rip which I have used. My guarantee from where I bought my iBook doesn't run out until October - so in theory I can go to them when I return.
    The freezing only occurs when I'm attached to the modem (though not neccesarily online), and seems to be better when it only runs off the battery. It is very confusing. It also seems to freeze more often when I type - it's not so bad when I'm just browsing.
    I'm writing this on a friend's computer to get all the info out there. I will check the responses but don't know if/when I will be able to type again as it's such a lottery...But I really would appreciate any help you can offer - and any advice about backing up my information.
    Many thanks,
    Zachary
    iBook G4   Mac OS X (10.3.9)  

  • Begging for help : Swing: networking

    I am getting problems after problems....i did this Swing applet to "activate" the server so that it waits for a request. the first time i ran it i got the java.security.accessdenied....etc...
    I changed the java.security to grant all permissions....
    I ran the following code...
    it hangs..the button gets stuck....
    what s the problem..
    Do i also post the java.security file?
    PLEASE HELP.
    import java.awt.*;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.net.*;
         public class appSNServerFile extends JApplet implements ActionListener{
              JButton activate;
              JTextArea ta;
                   public void init(){
                        activate = new JButton("Activate the Server");
                        ta = new JTextArea(10,10);
                        Container con = getContentPane();
                        con.setLayout(new FlowLayout());
                        con.add(activate);
                        con.add(ta);
                        activate.addActionListener(this);
                        public void actionPerformed(ActionEvent e){
                             String temp="";
                             try{
                                  InetAddress ip = InetAddress.getLocalHost();
                                  ServerSocket s = new ServerSocket(2000);
                                  ta.setText("The Server's IP is "+String.valueOf(ip)+"\n");
                                  for(;;){
                                       Socket c = s.accept();
                                       ta.setText(String.valueOf("Request received from the client "+c+"\n"));
                                       DataInputStream din = new DataInputStream(c.getInputStream());
                                       DataOutputStream dout = new DataOutputStream(c.getOutputStream());
                                       String filename = din.readUTF();
                                       BufferedReader b = new BufferedReader(new FileReader(filename));
                                       String content = "";
                                       while(true){
                                            String t = b.readLine();
                                            if(t==null) break;
                                            content += t + "\n";
                                       ta.setText(String.valueOf(content));
                                       catch(Exception ioe){
                                            ta.setText(String.valueOf(ioe));
         //<applet code = appSNServerFile height = 300 width = 300></applet>

    Look up the Java API on ServerSocket.accept()
    It blocks until a client makes a connection with it.
    Ie. that call will hang there forever, until a client tries to connect.
    A better approach is to create a separate thread, which waits for a client connection. Something like........
    Note : Not compiled nor tested... but gives general approach.
    import java.awt.*;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.net.*;
         public class appSNServerFile extends JApplet implements ActionListener, Runnable {
              ServerBackgroundThread backThread = new ServerBackgroundThread();
              JButton activate;
              JTextArea ta;
                   public void init(){
                        activate = new JButton("Activate the Server");
                        ta = new JTextArea(10,10);
                        Container con = getContentPane();
                        con.setLayout(new FlowLayout());
                        con.add(activate);
                        con.add(ta);
                        activate.addActionListener(this);
                   public void actionPerformed(ActionEvent e)
                        if ( !backThread.isRunning() )
                             backThread.start();
         class ServerBackgroundThread extends Thread
              boolean isRunning = false;
              public ServerBackgroundThread ( )
                   super();
              public boolean isRunning ( )
                   return ( isRunning );
              public void run ( )
                   isRunning = true;
                        String temp="";
                        try
                             InetAddress ip = InetAddress.getLocalHost();
                             ServerSocket s = new ServerSocket(2000);
                             // ta.setText("The Server's IP is "+String.valueOf(ip)+"\n");
                             updateTextField ( "The Server's IP is "+String.valueOf(ip)+"\n" );
                             for(;;)
                                  Socket c = s.accept();
                                  // ta.setText(String.valueOf("Request received from the client "+c+"\n"));
                                  updateTextField (String.valueOf("Request received from the client "+c+"\n"));
                                  DataInputStream din = new DataInputStream(c.getInputStream());
                                  DataOutputStream dout = new DataOutputStream(c.getOutputStream());
                                  String filename = din.readUTF();
                                  BufferedReader b = new BufferedReader(new FileReader(filename));
                                  String content = "";
                                  while(true)
                                       String t = b.readLine();
                                       if(t==null) break;
                                       content += t + "\n";                                   
                                  // ta.setText(String.valueOf(content));
                                  updateTextField ( String.valueOf(content));
                        catch(Exception ioe)
                             // ta.setText(String.valueOf(ioe));
                             updateTextField ( String.valueOf(ioe));
                        finally
                             isRunning = false;
              public void updateTextField ( String message )
                          // IMPORTANT : You can't update a Swing component in another
                          // Thread.  You must update it in a "Swing friendly" manner.
                          // Hence this helper function.
                   final Runnable runnable = new Runnable()
                       public void run()
                            ta.setText ( message );
                       } // run
                   };    // runnable
                   SwingUtilities.invokeLater(runnable);
         //<applet code = appSNServerFile height = 300 width = 300></applet>

  • Help - Restore Freeze

    Just purchased a refurbished 80bg video Ipod. It was previously formatted in Macintosh. Trying to restore it to be used on a windows PC, it consistently freezes during the restore process. Have tried two different computers, changing the power management on the System Buses, reinstalling USB drivers, restoring from disk mode - NOTHING WORKS.
    Any help is appreciated!

    Ok - got it to work. Was able to restore with no problems at work. Both my home computers had issues doing this task. I can't explain why it worked here rather than at home. At home I have a laptop and desktop networked together over wireless. One thing I did not do at home was unplug my printer (USB), all other USBs were unplugged. Another thought is that because I rarely connect my Ipod to my work computer (has been at least a year and a few iTunes updates later) is possibly why it worked correctly??? I will be holding my breath when I get home and see if both home computers will actually function with the Ipod and attempt to download my music library.

  • Help - Mac freeze

    I need help! When I connect to internet and open mail the computer freeze, I cannot open and close anything anymore and when trying to disconnect, internet connect is not disconnecting, I cannot force quit and the only way to tun off the computer is by switching off the button. Any help is very much appreaciated.
    Thanks, Giulio
    Powerbook 17   Mac OS X (10.4.3)  

    You'll need to provide more information on your hardware and system, and what you have tried, and are you still on 10.5.2? not a good idea.
    Apple Hardware Test
    Kernel Panic screen
    http://www.macmaps.com/kernelpanic.html
    http://reviews.cnet.com/8301-13727_7-10344626-263.html
    http://www.thexlab.com/faqs/kernelpanics.html

  • Help With Freezing Nano

    Ok, so my iPod works fine when it is connected to the computer, but it dies as soon as I disconnect it. The screen slices diagonally and freezes, and the picture slowly fades away.
    My computer says its fully charged, and I've tried resetting it and putting it into Disk mode, but still no luck. And it has been charging for quite a while now. Any suggestions would be much appreciated!!!
    Oh, and when I re-plug it into the computer, I have to re-select the language, as if it totally resets. It does this even when I dont reset it. By the way, I only reset it when its plugged into the computer, because it doesnt work at all when it isnt plugged in.
    Its about 4 days old.

    I need some help.... My Ipod was on its charger(computer) and my setting is that when the ipod is connected to the computer, Itunes would appear.stillI tunes would not appear but then my ipod will not turn on. The "Donot disconnect" screen will not go away and I donot know what to do. How do I get in contact with a Apple Store near me if the yellow pages and the wbsite isnt giving me anything? I have a 2-year warrenty

Maybe you are looking for

  • How can I calculate the frequency of a 2-4Hz three phase sine wave in 50msec?

    I want to calculate the frequency of a sine wave using either all three phases or just one, but I want to know the frequency after 50 msec, I don't want to have to wait for a full period.

  • IMG HPF Area Page Customizing not reflecting in Portal

    Hi, I'm near to smashing my keyboard, but before I do so, maybe someone is able to help me: In IMG Homepage Framework I've got a custom Area Page which has a Headline Area Description and an Area Description Longtext. I need to change the contents of

  • InputOutput error when importing SCORM 1.2 compliant content in OLM

    I'm attempting to import SCORM 1.2 content (from UPK) in OLM and I continue to get the error "The content upload failed (InputOutput error)". We've tried it on 9ias, AS10g, all give the same error. We used the SCORM example from Oracle, replaced the

  • Display mail image

    Hello, I would like to know how to display an image in the browser ? I got a mail where some image had attach into it. now i m using servlet to build a mail client. I can retrieve text/pain and text/html parts, but i cant find a method to display the

  • Photoshop Elements 11 DVD Problem Disc rejected

    I have this installation pack with serialnumber but my laptop keeps rejecting the install disc. 'what can I do to solve the problem? Thanks in advance Bergljot