JDK-6517021 : AWT versus Swing: Window flickering when a TextArea is dragged
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-01-24
  • Updated: 2011-01-19
  • Resolved: 2008-07-22
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2006]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Dell Inspiron 1200 (notebook)

A DESCRIPTION OF THE PROBLEM :
Open swing window (JFrame) and then AWT window with TextArea.
Draging the TextArea flickering the whole window

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. open Swing window
    "C:\Program Files\Java\jre1.5.0_10\bin\java" SwingJFrame
2. Minimize the command window
3. open AWT window
   "C:\Program Files\Java\jre1.5.0_10\bin\java" AWTFrame
4. Minimize the command window
5. make sure the AWTFrame window is inside the Swing window.
6. Drag the TextArea in the AWT window
7. The window is flickering
8. If not, please move the AWT window - make sure the AWT window is always inside the Swing window
9 If not, move the AWT window to outside of the Swing window (totally outside of the Swing window)
10. Drag the text in the AWT window
11.while the text is select,move the AWT window to inside the Swing window
12. and then drag the AWT window

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No flickering
ACTUAL -
Window is flickering

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
SwingJFrame.java

import javax.swing.*;
import java.awt.*;

public class SwingJFrame extends JFrame {

    public SwingJFrame() {
        JPanel p = new JPanel();
        p.setLayout(new BorderLayout());
        String txtContents =
            "111111111111111111111111111111111111111111111111111111111\n" +
            "222222222222222222222222222222222222222222222222222222222\n" +
            "333333333333333333333333333333333333333333333333333333333\n" +
            "444444444444444444444444444444444444444444444444444444444\n";

        JTextArea editor = new JTextArea(txtContents, 30, 80);
        p.add(editor, BorderLayout.CENTER);
        add(p);
    }

    public static void main(String args[]) {
        SwingJFrame sj = new SwingJFrame();
        sj.setTitle("SWING");
        sj.pack();
        sj.setLocation(50, 50);
        sj.setVisible(true);
    }
}


AWTFrame.java

import javax.swing.*;
import java.awt.*;

public class SwingJFrame extends JFrame {

    public SwingJFrame() {
        JPanel p = new JPanel();
        p.setLayout(new BorderLayout());
        String txtContents =
            "111111111111111111111111111111111111111111111111111111111\n" +
            "222222222222222222222222222222222222222222222222222222222\n" +
            "333333333333333333333333333333333333333333333333333333333\n" +
            "444444444444444444444444444444444444444444444444444444444\n";

        JTextArea editor = new JTextArea(txtContents, 30, 80);
        p.add(editor, BorderLayout.CENTER);
        add(p);
    }

    public static void main(String args[]) {
        SwingJFrame sj = new SwingJFrame();
        sj.setTitle("SWING");
        sj.pack();
        sj.setLocation(50, 50);
        sj.setVisible(true);
    }
}

---------- END SOURCE ----------
AWTFrame listed above is incorrect, it is the same as SwingJFrame. I'm attaching two correct tests to the change request.

Comments
EVALUATION I'm unable to reproduce this bug on my WinXP desktop, so this is probably Win2K issue.
29-01-2007