我目前正在尝试将JavaFX用于学校项目.尽管这对我来说并不是真正的问题,但有时让我烦恼的是,总是将@FXML标记始终放在每个声明之前,如下所示:
@FXML ListView accountsList;
@FXML ListView videosList;
@FXML ListView quizItems;
@FXML Label account_name;
@FXML Label account_quiz;
@FXML Label video_title;
@FXML Label video_desc;
@FXML Label item_a;
@FXML Label item_b;
@FXML Label item_c;
@FXML Label item_question;
我为什么不能这样做呢?
@FXML Label lbl1, lbl2, lbl3; // only lbl3 works, but the others not
// (lbl1, lbl2 is not detected in JavaFX SceneBuilder)
…或者正确的方法是什么?谢谢,请原谅我的英语语法.