swingx
  1. swingx
  2. SWINGX-1398

Safegaurd JXPanel painting against improper subclassing

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.3
    • Component/s: None
    • Labels:
      None

      Description

      We assume that JXPanel is a container and has no foreground. Some people incorrectly subclass J(X)Panel to create custom components with UI delegates. In such cases, those users could be painting a foreground in the UI delegate. Our background painter would actually paint over their foreground painting.

      Even though I would consider it an implementation bug on the users' part to do such a thing, we cannot prevent against such stupidity, but we can safe guard against it. We can call getUI().paint after we paint the background painter. This extra call will do nothing in core UI delegates (other than add the overhead of an unnecessary call), but it will show foreground in these poorly-designed components.

        Activity

        Hide
        Karl Schaefer added a comment -

        Issue 1398: Add a call to getUI().paint to safeguard against improper subclassing of JXPanel for custom components.

        swingx-core/src/main/java/org/jdesktop/swingx/JXPanel.java

        Committed revision 3930.

        Show
        Karl Schaefer added a comment - Issue 1398: Add a call to getUI().paint to safeguard against improper subclassing of JXPanel for custom components. swingx-core/src/main/java/org/jdesktop/swingx/JXPanel.java Committed revision 3930.

          People

          • Assignee:
            Karl Schaefer
            Reporter:
            Karl Schaefer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: