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

AWT versus Swing: Window flickering when a TextArea is dragged

XMLWordPrintable

    • x86
    • windows_xp

      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.

            son Oleg Sukhodolsky (Inactive)
            dav Andrei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: