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

XAWT: painting inconsistency

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b26
    • CPU:
      generic
    • OS:
      linux

      Description



      Name: rpR10076 Date: 09/12/2003


      Please see included test. It consists of one
      frame and a canvas.
      When run with MToolkit, or WToolkit, it first
      appears red. With XAWT, it first appears grey
      and only turns red if you resize the window.
      It is arguable whether the test is valid (it
      isn't a good thing to set background within
      paint() method), but I copied it from a real
      test case for another bug, so I believe people
      do that, and they may be disappointed with
      the fact that XAWT behaves inconsistently in
      this situation.

      === test program ===
      import java.awt.*;

      public class PaintBug extends Frame {
          private PaintBugCanvas fpc;

          public PaintBug() {
              fpc = new PaintBugCanvas();
              add(fpc);
          }

          public static void main(String[] args) {
              PaintBug fp = new PaintBug();
              fp.pack();
              fp.show();
          }
      }

      class PaintBugCanvas extends Canvas {

          public PaintBugCanvas() {
              setSize(200,200);
          }

          public void paint(Graphics g) {
              setBackground(Color.red);
              g.drawString("I should be red", 20, 20);
          }
      }
      === test program ===

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yan Yuri Nesterenko
              Reporter:
              prssunw Prs Prs (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: