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

Extra slow repaint when window is covered by another window

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.2.2
    • client-libs
    • x86
    • windows_nt



      Name: clC74495 Date: 06/02/99


      This example demonstrates extra slow repaint of a Frame when it is covered by any other window.
      Exact steps to reproduce the problem on Windows NT 4.0 are:
      1. Compile and start Test12.java (below)
      2. Bring any always-on-top window, for instance Windows Task Manager
      3. Maximize Test12 Frame window, you'll see the effect
      Notice that when there are no top-level windows, i.e. when Test12 does not
      become covered by other windows after it is maximized, it is working fine.
      Also, after starting Test12 try to simply move any other window on top of
      Test12's Frame. That results in a very slow repaint taking dozens of seconds
      and effectively hanging the entire computer for that time.
      Test12 uses the simpliest AWT calls and I think that should work as well as
      it was working in all 1.1.x versions but never worked with any 1.2.x any more:

      // this is a very simple program which extends Frame
      // and only paints a number of strings in the
      // implementation of it's paint() method.
      // (to stop Test12 use Ctrl-C).
      import java.awt.*;
      public class Test12 extends Frame {
          
          Font pfont = new Font("SansSerif",Font.PLAIN,11);

          public Test12() {
              super("Test Simple Paint");
              setBounds(50,50,380,380);
              setVisible(true);
          }
          
          public void paint(Graphics g) {
              g.setFont(pfont);
              g.setColor(Color.black);
              for (int i=0; i<30; i++)
                  g.drawString("String "+(i+1),6+i*10,32+i*12);
          }

          public static void main(String[] args) {
              // use Ctrl-C to kill it when you're done
              new Test12();
          }
      }
      (Review ID: 83787)
      ======================================================================

            mmartaksunw Michael Martak (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: