3

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?

2 Answers 2

8

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

Sign up to request clarification or add additional context in comments.

Comments

2

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.

1 Comment

Will they be accessible in the future?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.