JavaFx
cdcdec
这个作者很懒,什么都没留下…
展开
-
JavaFx loading 数据加载中效果
JavaFx loading请求网络时显示loading(数据加载中),请求结束后loading消失。代码来于:https://blog.csdn.net/loongshawn/article/details/52996382,有改动。import javafx.scene.Scene;import javafx.scene.control.Label;import javafx....原创 2018-06-16 14:22:37 · 8574 阅读 · 3 评论 -
JavaFx在同一个Scence/Window加载新的fxml,以及在Controller中获取Stage
有这样的一种场景:在一个界面A中有一个按钮,点击这个按钮后,会弹出界面B,此时界面A已经不存在了。//这是界面A的Controllerpublic class HBoxMainController { @FXML private VBox rootVBox;//这是界面A的根布局的id @FXML private Button getPath;//这是界面...原创 2018-06-16 14:08:03 · 5411 阅读 · 2 评论 -
JavaFX需要在主线程更新UI
java.lang.IllegalStateException: Not on FX application threadJavaFx如果在子线程更新UI,会报错 java.lang.IllegalStateException: Not on FX application thread; currentThread =在子线程里执行以下代码,可解决此问题:Platform.r...原创 2018-06-16 13:54:51 · 3745 阅读 · 0 评论 -
JavaFX通过xml和通过java文件构建
JavaFX通过xml和通过java文件构建通过xml,使用Parent和其子类效果一样public void start(Stage primaryStage) throws Exception{ //使用Parent,生成的界面是居中的。 Parent root = FXMLLoader.load(getClass().getResource("/HBoxMai...原创 2018-06-18 08:45:51 · 1740 阅读 · 0 评论