<Swing Dev> [9] Review request for 8136366 Add a public API to create a L&F without installation

Philip Race philip.race at oracle.com
Fri Apr 1 00:32:17 UTC 2016


 > I recall that it was possible to initialize the windows l&f on linux

Do you mean it was "impossible" ?

As far as I can tell this API lets you create (initialize) as you always 
could
although previously you could not get a handle to it, but with this
change even if you can obtain the L&F you still can't install it.
But there is a good question there .. will it fail in some way when you
call methods on even if it is not installed it if it is not on the 
appropriate platform ?
Perhaps due to missing native library support ?
If that or anything else is a concern then we should call
isSupportedLookAndFeel() to check before returning it (and document that).
Possibly this will cause an issue for people who were doing this 
directly on the
unsupported platform and did not have to deal with that check, but I doubt
that anyone ought to do that anyway.

So probably best to add the check.

-phil.

On 3/31/16, 5:07 PM, Sergey Bylokhov wrote:
> On 31.03.16 9:50, Alexandr Scherbatiy wrote:
>>    Some Swing L&Fs are not public. It is not possible to create them
>> using reflection now in JDK 9 because of the modularization feature.
>>    There are use cases when some information should be obtained from a
>> L&F without its installation
>>     - check if L&F is supported
>>     - take some defaults to use it in custom L&F
>>
>>    The proposed solution adds UIManager.createLookAndFeel(className)
>> method which allows to create a given L&F without installation.
>
> It is interesting should we allow creation of any L&F or only those 
> which were installed and/or supported? I recall that it was possible 
> to initialize the windows l&f on linux, Will the new method add a 
> possibility to create it? if yes should we support that?
>
>



More information about the swing-dev mailing list