添加菜单栏兼容
This commit is contained in:
parent
a5f09a8bcc
commit
9139cec049
14
build.gradle
14
build.gradle
|
@ -1,8 +1,19 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.openjfx:javafx-plugin:0.0.12'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'maven-publish'
|
||||
id 'org.openjfx.javafxplugin' version '0.0.11'
|
||||
id 'org.openjfx.javafxplugin' version '0.0.12'
|
||||
id 'org.beryx.jlink' version '2.24.4'
|
||||
}
|
||||
|
||||
|
@ -45,6 +56,7 @@ sourceCompatibility = '17'
|
|||
javafx {
|
||||
version = "17.0.2"
|
||||
modules = ['javafx.controls', 'javafx.fxml', 'javafx.media', 'javafx.swing', 'javafx.web']
|
||||
configuration = 'compileOnly'
|
||||
}
|
||||
|
||||
jlink {
|
||||
|
|
|
@ -50,6 +50,7 @@ public class XJavaFxToolApplication extends Application {
|
|||
// 2. 新UI使用独立的ClassLoader加载插件,兼容性更好;
|
||||
// 3. 新UI本身体验较好。
|
||||
loadNewUI(primaryStage);
|
||||
// loadClassicUI(primaryStage);
|
||||
|
||||
StageUtils.loadPrimaryStageBound(primaryStage);
|
||||
primaryStage.show();
|
||||
|
|
|
@ -111,6 +111,7 @@ public class IndexController extends IndexView {
|
|||
}
|
||||
|
||||
private void initEvent() {
|
||||
mainMenuBar.setUseSystemMenuBar(true);
|
||||
myTextField.textProperty().addListener((observable, oldValue, newValue) -> selectAction(newValue));
|
||||
myButton.setOnAction(arg0 -> {
|
||||
selectAction(myTextField.getText());
|
||||
|
|
Loading…
Reference in New Issue