Java FX 2 CSS Pseudo Classes


Question

How can I create my own CSS pseudo classes in Java FX 2?

So that in CSS file I could use this style

.MyButton : online{ }

In FX 1 it could be done overriding methods like

 public long impl_getPseudoClassState() {}

but they are now deprecated :-(

Is there a new way?

1
2
2/9/2012 9:40:32 AM

Accepted Answer

Currently you can't do it. Here is what is stated in JavaFX CSS Reference Guide about this:

At this time, the programming interfaces necessary for a class to declare support for CSS properties, to convert and load these values from CSS style sheets into object variables, and to declare and notify changes to an object's pseudo-classes, are considered internal interfaces and are not accessible directly to applications.

2
2/13/2012 12:37:33 AM

With the public API of JavaFX 8.0 it is possible to introduce custom css pseudo classes.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon