36

I'm trying to learn JavaFX 2.0 + FXML, and i found it kind of uncomfortable to make fxml file, without knowing what i can put in it and what i can't. I mean which tags are possible in FXML, which attributes evety tag has? which values evety attribute can have, and so on. There are some examples in a web, but they don't show the hole capabilities of FXML. I've tried to use NetBeans and Eclipse plugins for JavaFX 2.0, but, both of them does not have any intelences for FXML, they just validate open-close tags and other simple things, which evety XML editor can do. Maybe i've configured these plugins wrongly. So, is there any documentatin with full reference (all tags, attributes and its possible values) of FXML?

Victoria Agafonova
  • 2,048
  • 10
  • 33
  • 50

2 Answers2

41

FXML Reference

Introduction to FXML describes the syntax and usage patterns of the markup and is important to study when learning FXML. It does not define all elements usable in FXML.

There will never be a full reference (nor xml schema) for FXML as it works by reflecting on Java classes in the classpath and defining elements and attributes based on the properties of the classes.

FXML's creator (Greg Brown) suggests:

So currently Javadoc is the best reference.

For future Javadoc revisions of JavaFX, the JavaFX team is considering including FXML examples in the Javadoc.

This forum thread and this forum thread contains discussions about and links to fxml documentation.

FXML code completion in IDEs

These IDE inference engines work by reflecting on Java classes the same way the FXML implementation does.

When you use a library like ControlsFX, or develop your own JavaFX components, the IDE code completion is able to make use of the new classes and attributes you have created or linked.

jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • JavaFX 2 will be [supported by IntelliJ Idea 12.1](http://blogs.jetbrains.com/idea/2013/02/support-for-javafx-2-in-intellij-idea-121/) and above. The JavaFX plugin provides FXML code completion as well. – mwalter Feb 26 '13 at 22:44
  • 4
    The [CSS reference](http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html) is also useful. – Korki Korkig Apr 02 '13 at 07:39
  • 2
    A reference is still required to describe each element's behaviour, attributes that apply and how they are displayed/used. At best the references listed here can be ambiguous and sometimes contradictary. – will May 29 '14 at 03:46
  • 3
    Seriously!? I've been spending today looking for FXML documentation, only to end up at this S.O. post. This is really retarded i.m.o., FXML as i see it differs here and there, so this is pretty useless i'd say. Java / Oracle keeps scoring negative points, here... :/ – Michahell Aug 20 '14 at 15:46
3

To keep the answer updated here is the Javadoc for Javafx 8.

Chaoskatze
  • 41
  • 9
c0der
  • 18,467
  • 6
  • 33
  • 65
  • 1
    And here's the [CSS Reference Guide](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html) for JavaFX 8. – Gary Feb 07 '21 at 16:33