Handling updates to the JavaFX Caspian look

Jonathan Giles jonathan.giles at oracle.com
Mon Apr 23 12:59:58 PDT 2012

Hi all (again),

I've put up a very preliminary patch attached to RT-19713 [1] that 
allows for people to set a default user agent stylesheet for their 
entire application. If the default stylesheet is not overridden by the 
developer, then they will be automatically updated to the latest 
stylesheet - should we ever decide to make another one. The main driver 
for this tweak is to prevent JavaFX user interfaces becoming stale in 
the same way Swing user interfaces were stuck using Metal L&F.

Please, if you have time, review the comments in the jira issue itself 
to understand more of the problem space.

Finally, as noted, this is a preliminary patch - there are tweaks to be 
made for sure. Already, David Grieve has commented on the Jira issue 
about suggested changes. I look forward to your suggestions too.

[1] http://javafx-jira.kenai.com/browse/RT-19713

-- Jonathan

On 14/03/2012 12:47 p.m., Jonathan Giles wrote:
> Hi all,
> Today I came across the RT-19713 [1] Jira issue I filed against myself 
> recently. This Jira issue basically states that we should have API in 
> JavaFX that allows for developers to lock down and specify a 
> particular default stylesheet, and if this isn't specified by the 
> developer, they will be automatically updated in future releases if we 
> ever consider changing the default style sheet. We would always ship 
> earlier style sheets as well, so if the preference was set, the style 
> sheet would be there in the jar file.
> The reason why I want this feature is that I've seen tweaked caspian 
> style sheets (for example the one used in the upcoming Scene Builder 
> tool) that I would one day love to be the default style sheet for 
> JavaFX as it (in my opinion) is more refined. Similarly, I don't think 
> anyone wants to end up in the same situation as Swing, where the 
> default L&F is Metal, because moving the default to a more modern L&F 
> would potentially break (or at least maim) many deployed Swing 
> applications.
> Ideally we would have had API like this from the get-go, but alas, it 
> did not happen. Adding API now that by default auto-updates people is 
> of course breaking a contract we have with developers, but I feel that 
> it is better to break this contract now than to forever wish that we 
> could provide a new style sheet and never be able to do it. I think 
> the main thing is to communicate this change as loudly and from as 
> many roof tops as possible. Perhaps there are others on this list that 
> disagree and have different opinions. Feel free to share them.
> Finally, as of now, there is no intention to ship an updated style 
> sheet that would replace the default, but I'm looking ahead to future 
> releases where this may be desired. Perhaps JavaFX 3.0 may include a 
> visual refresh, for example. If anyone has any thoughts on this 
> proposal, please reply on this thread (and preferably also leave a 
> comment on the Jira issue). I don't have any proposed API for this 
> issue, but if anyone has any thoughts on this, please feel free to 
> share them also.
> [1] http://javafx-jira.kenai.com/browse/RT-19713
> Thanks,
> Jonathan

More information about the openjfx-dev mailing list