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

后端 未结 4 966
广开言路
广开言路 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:01

    id you use to set a CSS ID to your Component, for example and in your stylesheet you have something like #welcome-text { font-size: 16pt; } so this will be applied to your Text.

    fx:id you use if you want to work with your Components in your Controller class, where you annotate them with @FXML Text myWelcomeText.

提交回复
热议问题