What's the difference between fx:id and id: in JavaFX?

后端 未结 4 930
广开言路
广开言路 2020-11-22 05:50

Maybe a really newbie\'s question....

I\'m starting learning JavaFX in a FMXL Application using the Scene Builder, by reading this tutorials:

http://docs.ora

4条回答
  •  执笔经年
    2020-11-22 06:05

    I took a look at an FXML document generated using the JavaFX Scene Builder. You access controls from Java Controller with the fx:id. (edit) I stand corrected, the id does matter.

    You can apply css from the FXML document like this:

    
    

    (Replace slider with any control)

    And Java controller interaction:

    @FXML
    Slider myslider;
    

提交回复
热议问题