JDK-6264806 : REGRESSION:Win L&F: Repainting slowdown in 5.0 JTabbedPane
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-05-03
  • Updated: 2010-05-09
  • Resolved: 2006-05-02
Related Reports
Duplicate :  
Relates :  
Description
J2SE Version (please include all output from java -version flag):
 5.0, 5.0u1, 5.0u2

Does this problem occur on J2SE 1.4.x or 5.0.x ?  Yes / No (pick one)
  No, works fine with 1.4.2

Operating System Configuration Information (be specific):
  WinXP and XP look and fell

Bug Description:

   Discovered a performance decrease in JDK 1.5. The problem happens when the 
   look and feel of Swing is Windows, and the operating system is Windows XP and 
   the look and feel of Windows is XP (as opposed to Classic). 

   The application has a tabbed pane and it takes a lot slower to repaint with 
   JDK 1.5.0_02 than with JDK 1.4.2_08. JDK 1.5.0_01 and JDK 1.5.0 have the same
   problem. Attached is an export file from OptimizeIt showing where the slowdown
   is (jdk1.5slow.html). Also attach 3 snapshots saved with Borland OptimizeIt 
   Suite 6.0.
 
Steps to Reproduce (be specific):

   To use Tomsawyer's main demo. Just log into the www.tomsawyer.com website. 
   use javasoft account, check password on comment field.
   Then go to

     http://www.tomsawyer.com/temp/tsvj.700.jnlp
 
    To run the demo.
    Run it with JDK 1.4 and JDK 1.5 and compare the performance of the following
    operation:
 
    1) In the main menu, go to Tools | Create Nodes.
    2) Quickly click on the white canvas multiple times in different 
       places and you'll see yellow rectangles appear in those places. The
       repainting rate and general performance is much slower in JDK 1.5

###@###.### 2005-05-03 18:39:02 GMT

Comments
EVALUATION Verified with customers code that the slowdown is no longer reproducible on 1.6, most likely due to caching. Closing bug out as a duplicate of the bug that added the caching logic.
02-05-2006

EVALUATION I'm hoping the caching of images drawn by XP has fixed this problem. I tried the test case from the customer, but the URL no longer works. I've contacted the customer and will move out of incomplete once we get more information.
02-05-2006

EVALUATION Caching will be added to 5.0u8 as the fix for 5106661 is backported from Mustang.
08-03-2006

EVALUATION This regression is caused by a new background image that was added to JTabbedPane running in Windows L&F. This image is not cached in 5.x but is cached as of 6.0. Note that the regression is noticable for applications that do frequent repaints of the tab pane. It should not affect applications that cover the tab pane with an opaque panel, such as the demo described here. It is important to set the opaque property to true on components that paint their own background, to avoid unnecessary painting of the covered image. Using a JPanel is safe, because it is opaque by default. I will lower the priority and investigate the possibility of adding caching to a 5.0 update release. ###@###.### 2005-05-10 21:12:45 GMT
10-05-2005

WORK AROUND If using a JComponent other than JPanel to cover the tab with its own background painting, make sure to call setOpaque(true) on it. This is not just a workaround, it is the recommended standard. ###@###.### 2005-05-10 21:12:45 GMT
10-05-2005