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

exposed/damaged canvases don't always update correctly on win32

XMLWordPrintable

    • kestrel
    • x86
    • generic, windows_95, windows_nt

      canvases don't repaint correctly when exposed on win32 (only --
      this problem does not repro on solaris). the problem is generic
      and may involve synchronization of damage with repair. in the
      example code shown below, it is not easy to cause the problem to
      occur (it may take a couple minutes of damaging the canvas to get
      repaint problems), but that is no indication that the problem is
      insignificant. in fact, it may be responsible for all sorts of
      paint problems...

      import java.applet.*;
      import java.awt.*;

      class Foo extends Canvas
      {
          public void paint(Graphics g)
          {
              for (int i = 0; i < 100; i += 2)
              {
                  g.drawString("this is a test of foo", i, i);
              }
          }

          public Dimension getPreferredSize()
          {
              return new Dimension(100, 100);
          }

          public Dimension getMinimumSize()
          {
              return getPreferredSize();
          }
      }

      public class test extends Applet
      {
          public void init()
          {
              setLayout(new FlowLayout());
              add(new Foo());
              add(new Foo());
              add(new Foo());
          }
      }


            busersunw Btplusnull User (Inactive)
            jlockesunw Jonathan Locke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: