<Swing Dev> [9] Review Request: 4339584 Adding a getUI public method to JComponent

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Fri Aug 21 10:04:37 UTC 2015


Hello.
Please review a small fix for jdk9.

Long long time ago the next request was filed for jdk 1.4.0:
"Today, there is no way for a program to access the UI of a JComponent. 
Adding a getUI method would provide that capability and be consistent 
with the fact that, for example, the JComponent's Border is accessible"

It was evaluated and was closed:
"JComponent does not have a getUI so that each class can override it to 
return the UI that is appropriate for the class, such as TreeUI or 
TextUI..."

The problem was in absent of covariant returns, which were added to the 
jdk 1.5. So now we can add the "ComponentUI getUI()" method to the 
JComponent and in the same time we will have an ability to override it 
using more specific return value in subclasses.

Bug: https://bugs.openjdk.java.net/browse/JDK-4339584
Webrev can be found at: http://cr.openjdk.java.net/~serb/4339584/webrev.00

-- 
Best regards, Sergey.




More information about the swing-dev mailing list