[SWINGX-1398] Safegaurd JXPanel painting against improper subclassing Created: 02/Mar/11  Updated: 04/Mar/11  Resolved: 02/Mar/11

Status: Resolved
Project: swingx
Component/s: None
Affects Version/s: 1.6.2
Fix Version/s: 1.6.3

Type: Bug Priority: Major
Reporter: Karl Schaefer Assignee: Karl Schaefer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


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.

Comment by Karl Schaefer [ 02/Mar/11 ]

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


Committed revision 3930.

Generated at Tue Sep 27 22:29:30 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.