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

AWT components flicker on programmatic resize

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 1.4.2, 5.0
    • client-libs
    • generic, x86
    • generic, windows_2000, windows_xp

      Name: ssR10077 Date: 11/18/2003

      ###@###.###
      I've tested on Tiger b28
      The following test flickers on Win32 and XAWT but doesn't on Motif

      import java.awt.*;
      public class FrameFlicker extends Frame {
          public static void main(String[] args) {
              Frame frame = new FrameFlicker();
              frame.setSize(50,50);
              frame.setVisible(true);
          }
          public void paint(Graphics g) {
              g.setColor(Color.RED);
              Rectangle clip = g.getClipBounds();
              g.fillRect(clip.x, clip.y, clip.width, clip.height);
              if (getHeight() < 500) {
                  setSize(getWidth() + 1, getHeight() + 1);
              } else {
                  System.exit(0);
              }
          }
      }

      The following test flickers on all toolkits

      import java.awt.*;
      public class CanvasFlicker extends Canvas {
          static Frame frame = new Frame();
          public static void main(String[] args) {
              frame.add(new CanvasFlicker());
              frame.setSize(50,50);
              frame.setVisible(true);
          }
          public void paint(Graphics g) {
              g.setColor(Color.RED);
              Rectangle clip = g.getClipBounds();
              g.fillRect(clip.x, clip.y, clip.width, clip.height);
              if (frame.getHeight() < 500) {
                  frame.setSize(frame.getWidth() + 1, frame.getHeight() + 1);
                  frame.validate();
              } else {
                  System.exit(0);
              }
          }
      }

      ======================================================================

            son Oleg Sukhodolsky (Inactive)
            ssisunw Ssi Ssi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: