Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6556864

App hangs when setBounds with very big width is called on toolbar component

XMLWordPrintable

      When NetBeans IDE main window is resized horizontaly to minimum width 0 using Alt-Middle mouse button and then resized back, main window stays grey, CPU is at 100%, from thread dump Swing repaints main window again and again. It is always reproducible. I use JDK 6u1 (it is also reproducible with latest JDK 7 build 12). OS is Ubuntu Feisty 7.04. It happens only with Metal L&F. I was not able to reproduce it with GTK L&F.

      I tried to run minimum IDE so I used platform (core) and I found it happens only when our toolbar is enabled/visible. AFAIK we do not use custom RepaintManager. I was not able to reproduce this issue with Toolbar demo. I will attach thread dump samples.
      Development builds of NetBeans IDE/Platform 6.0 can be downloaded at http://www.netbeans.info/downloads/dev.php. As we have default GTK L&F for JDK 6u1 and later use following command line option to start with Metal L&F: --laf javax.swing.plaf.metal.MetalLookAndFeel
      I found code in IDE responsible for this behavior. When main window width goes to zero width of toolbar is set to incorrect value (very high close to Integer.MAX_VALUE). It happens after call of setBounds with very high value of width. So I fixed this in our code. Still I think Swing should not get into this state (ie. CPU 100%, blocked AWT thread, need to kill app). Is this solvable? I attach simple test app (with one icon) to reproduce this behavior.

            jasper Jasper Potts (Inactive)
            mslamasunw Marek Slama (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: