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

Provide public APIs to set background erase properties

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Cannot Reproduce
    • Icon: P5 P5
    • None
    • 6
    • client-libs
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      Related to bug #6691181. AWT should provide public APIs for setting the following system properties:

      sun.awt.noerasebackground
      sun.awt.erasebackgroundonresize

      JUSTIFICATION :
      It is currently impossible to disable the "flicker" effect when an applet is resized (even in J6u10).

      ---------- BEGIN SOURCE ----------
      import java.applet.Applet;

      import java.awt.BorderLayout;
      import java.awt.Canvas;
      import java.awt.Color;
      import java.awt.Graphics;

      public class AppletTest extends Applet {
          public static final long serialVersionUID = 0;
          
          public static class TestCanvas extends Canvas {
              public static final long serialVersionUID = 0;

              @Override
              public void paint(Graphics graphics) {
                  graphics.setColor(Color.RED);
                  graphics.fillRect(0, 0, getWidth(), getHeight());
              }

              @Override
              public void update(Graphics graphics) {
                  paint(graphics);
              }
          }

          @Override
          public void init() {
              setLayout(new BorderLayout());
              add(new TestCanvas(), BorderLayout.CENTER);
          }

          @Override
          public void update(Graphics graphics) {
              paint(graphics);
          }
      }


      ---------- END SOURCE ----------

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: