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

Bad paint logic

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P1 P1
    • None
    • 1.2.0
    • client-libs
    • sparc
    • solaris_2.5.1

      Compile and run the attached test case. The three buttons in the control frame cause a small 10 x 10 region in the center of the test bed frame to be redrawn by sending repaint() to either the content pane (drawn in red), or one of the two JComponents (drawn in blue and green) in the content pane. Clicking the "Repaint green component" button will show the region being invalidated.

      I get the following output when I click the content pane, blue component, and green component buttons, respectively:

      Command = content pane
      Painting content pane
      Painting green component
      Painting blue component
      Command = blue component
      Painting blue component
      Command = green component
      Painting green component

      Both the green component case and the content pane case are incorrect. Neither one should cause any paint()'ing to occur since the blue component is setOpaque(true) and it obscures both the green component and the content pane in this region.

            jeff Jeff Dinkins
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: