use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.
the class LoginApp method start.
@Override
public void start(Stage primaryStage) throws Exception {
// 窗口无装饰
primaryStage.initStyle(StageStyle.TRANSPARENT);
FXMLLoader loader = new FXMLLoader();
loader.setResources(ResourceBundle.getBundle("i18n/messages"));
Region loginView = loader.load(LoginApp.class.getResourceAsStream("/view/Login.fxml"));
LoginController loginController = loader.getController();
loader = new FXMLLoader();
loader.setResources(ResourceBundle.getBundle("i18n/messages"));
Region settingView = loader.load(LoginApp.class.getResourceAsStream("/view/Network.fxml"));
NetworkController settingController = loader.getController();
// 手动注入
settingController.setLoginView(loginView);
//
loginController.setSettingView(settingView);
// 背景无填充
Scene scene = new Scene(loginView);
scene.setOnMouseDragged(e -> {
primaryStage.setX(e.getScreenX() + xOffset);
primaryStage.setY(e.getScreenY() + yOffset);
});
scene.setOnMousePressed(e -> {
// 按下鼠标后,记录当前鼠标的坐标
xOffset = primaryStage.getX() - e.getScreenX();
yOffset = primaryStage.getY() - e.getScreenY();
});
scene.setFill(null);
primaryStage.setScene(scene);
primaryStage.show();
}
use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.
the class LeftMenu method loadFXML.
private void loadFXML() {
FXMLLoader loader = new FXMLLoader();
URL fxmlUrl = this.getClass().getResource("/view/LeftMenu.fxml");
loader.setLocation(fxmlUrl);
loader.setController(this);
loader.setRoot(this);
try {
loader.load();
LOG.debug("加载FXML界面{}完成", fxmlUrl);
} catch (IOException e) {
e.printStackTrace();
LOG.error("加载FXML界面{}失败,错误信息:{}", fxmlUrl, e.getMessage());
}
}
use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.
the class StudentQuestionPaper method loadFXML.
/**
* 加载界面布局文件
*/
private void loadFXML() {
FXMLLoader loader = new FXMLLoader();
URL fxmlUrl = this.getClass().getResource("/view/record/PaperForStudent.fxml");
loader.setLocation(fxmlUrl);
loader.setController(this);
loader.setRoot(this);
loader.setResources(ResourceBundle.getBundle("i18n/messages"));
try {
loader.load();
LOG.debug("加载FXML界面{}完成", fxmlUrl);
} catch (IOException e) {
e.printStackTrace();
LOG.error("加载FXML界面{}失败,错误信息:{}", fxmlUrl, e.getMessage());
}
}
use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.
the class TeacherQuestionPaper method loadFXML.
/**
* 加载界面布局文件
*/
private void loadFXML() {
FXMLLoader loader = new FXMLLoader();
URL fxmlUrl = this.getClass().getResource("/view/record/PaperForTeacher.fxml");
loader.setLocation(fxmlUrl);
loader.setController(this);
loader.setRoot(this);
loader.setResources(ResourceBundle.getBundle("i18n/messages"));
try {
loader.load();
LOG.debug("加载FXML界面{}完成", fxmlUrl);
} catch (IOException e) {
e.printStackTrace();
LOG.error("加载FXML界面{}失败,错误信息:{}", fxmlUrl, e.getMessage());
}
}
use of javafx.fxml.FXMLLoader in project TeachingInSimulation by ScOrPiOzzy.
the class ResourceList method loadFXML.
private void loadFXML() {
FXMLLoader loader = new FXMLLoader();
URL fxmlUrl = this.getClass().getResource("/view/resource/List.fxml");
loader.setLocation(fxmlUrl);
loader.setController(this);
loader.setRoot(this);
loader.setResources(ResourceBundle.getBundle("i18n/messages"));
try {
loader.load();
LOG.debug("加载FXML界面{}完成", fxmlUrl);
} catch (IOException e) {
e.printStackTrace();
LOG.error("加载FXML界面{}失败,错误信息:{}", fxmlUrl, e.getMessage());
}
}
Aggregations