JDK-4155103 : JFrame, JDialog, JWindow, and JApplet don't use RepaintManager
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1,1.1.6,1.2.0,1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS:
    generic,solaris_2.6,solaris_7,solaris_10,windows_98,windows_nt generic,solaris_2.6,solaris_7,solaris_10,windows_98,windows_nt
  • CPU: generic,x86,sparc
  • Submitted: 1998-07-07
  • Updated: 2005-03-15
  • Resolved: 2005-03-15
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
JFrame, JDialog, JWindow, and JApplet don't use RepaintManager because
they do not extend from JComponent, hence their repaint()  method defaults
to that of Component.repaint(), which uses AWT's update scheme.

All Swing components need to go through the RepaintManager mechanism.

EVALUATION This is true, however since a typical JFrame/JDialog/JWindow is completely filled by a Swing component (typically the contentPane), this turns out not to matter very much. There is rarely an occasion for even calling repaint() directly on a JFrame/JDialog/JWindow. amy.fowler@Eng 1998-12-11 Copied from evaluation of 4202651: The problem is really tied to Swing's double-buffer repaint machinery, which doesn't deal well with the condition where a non-opaque component (one which doesn't paint all it's own bits) is the first component in the hierarchy to paint. It's relying on this first component to clear it's background (and hence the contents of the buffer), however in this bug's case the JTabbedPane's opacity is false and so it does not clear the background before painting itself, which results in the buffer never being cleared - hence garbage gets painted. I think the best solution may be to pull the toplevel Swing classes (JFrame, JDialog, JWindow, JApplet) into the repaint algorithms (currently they don't render into the buffer) so that the background of the buffer will initially always be rendered with the background of the topmost component (frame/dialog/window/applet), which is by definition (at least currently) to be opaque. amy.fowler@Eng 2000-03-15 As this is new functionality, I'm moving this over to an RFE. scott.violet@eng 2001-06-22 If we do this, we should make sure that this addresses 4178413 as well. ###@###.### 2001-10-22 RepaintManager now handles painting for Swing's top levels (JFrame, JDiallog, JWindow and JApplet). This work was done as part of 4967886. I'm closing this bug out appropriately. Contrary to my earlier note this does not fix 4178413, I'm reopening that bug. ###@###.### 2005-03-15 18:19:54 GMT

PUBLIC COMMENTS JFrame, JDialog, JWindow, and JApplet don't use RepaintManager.