JDK-6216973 : JScrollPane flashes during scolling when partially off screen
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2005-01-13
  • Updated: 2010-04-02
  • Resolved: 2005-08-19
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Linux pmuellerslinux 2.4.18 #18 SMP Mon Feb 24 11:42:05 EST 2003 i686 unknown

A DESCRIPTION OF THE PROBLEM :
When a JScrollPane is partially off screen on Linux or Solaris (the Windows behavior is fine) there is noticable flashing during scrolling.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the SwingSet2 demo
Select the JScrollPane demo
Use the horizontal scroller and notice how smoothly the view is repainted.
Reposition the demo window so that it is partially off screen to the right.
Use the horizontal scroller again and notice the gray flashes

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect the performance with the JScrollPane partially off screen to be comparable to that with it fully on screen.

REPRODUCIBILITY :
This bug can be reproduced always.
###@###.### 2005-1-13 01:56:23 GMT

Comments
EVALUATION As buffer per window has been enabled on Unix now (6261582), this is no longer reproducible. Closing as a duplicate.
19-08-2005

EVALUATION Swing uses copyArea for scrolling. copyArea, as the name implies, copies one area of the component to another area. This is extremely effective as it means Swing doesn't have to cache the contents using images or others means. There are down sides though. In particular if the region is not entirely visible copyArea may generate garbage. This is what is happening here. We're copying part of the region that isn't visible and AWT/2D end up filling the region in gray. A PaintEvent is latest generated and we fix things, but there is that momentary flash. There are a couple of things we could do: 1. Try and detect if we're obscured and not do a copyArea. This is bad in that we'll have to redraw the complete widget, even if we could copy part of it. 2. Enable buffer per window on Linux. In such a scenario we don't directly do copyArea on screen and this should go away. There is an open bug on 2 (6261582), so I'm going to revisit this after we decide on 2.
25-07-2005