如果我们有一个Stage那么Scene包括2个PaneS中的第一个Pane包含Button与第二Pane是空的,我们可以加载其他FXML这个文件里面第2次Pane?
fxml1: VBox
|_Pane1-->Button
|_Pane2
///////////////
fxml2: Pane--> Welcome to fxml 2
"when we click the button load the fxml2 inside Pane2 of fxml1"
Run Code Online (Sandbox Code Playgroud)
然后点击
====我终于在尝试后发现了这个作品!====谢谢你们
@FXML Pane secPane;
public void loadFxml (ActionEvent event) {
Pane newLoadedPane = FXMLLoader.load(getClass().getResource("/application/fxml2.fxml"));
secPane.getChildren().add(newLoadedPane);
}
Run Code Online (Sandbox Code Playgroud) 我使用此方法设置datepicker值,但有时会抛出异常:
public static final LocalDate LOCAL_DATE (String dateString){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
LocalDate localDate = LocalDate.parse(dateString, formatter);
return localDate;
}
try {
datePicker.setValue(LOCAL_DATE("2016-05-01");
} catch (NullPointerException e) {
}
//the exception:
java.time.format.DateTimeParseException: Text '' could not be parsed at index 0
Run Code Online (Sandbox Code Playgroud)
那么这里有什么不对?
以下不起作用,我如何搜索存储在阿拉伯语中的数据
SELECT * FROM `users` WHERE `name` LIKE = "%????%"
Run Code Online (Sandbox Code Playgroud)
那给了我错误的SQL查询