下面列出了javafx.scene.layout.AnchorPane#setBackground ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private Node getGapNode(double value) {
AnchorPane tempPane = new AnchorPane();
tempPane.setPrefWidth(value);
tempPane.setPrefHeight(value);
tempPane.setBackground(Background.EMPTY);
return tempPane;
}
private Node getGapNode(double value) {
AnchorPane tempPane = new AnchorPane();
tempPane.setPrefWidth(value);
tempPane.setPrefHeight(value);
tempPane.setBackground(Background.EMPTY);
return tempPane;
}
public Node getGapNode(double value) {
AnchorPane pane = new AnchorPane();
pane.setPrefWidth(value);
pane.setPrefHeight(value);
pane.setBackground(Background.EMPTY);
return pane;
}
private Node getGapNode(double value) {
AnchorPane tempPane = new AnchorPane();
tempPane.setPrefWidth(value);
tempPane.setPrefHeight(value);
tempPane.setBackground(Background.EMPTY);
return tempPane;
}
private Node getGapNode(double value) {
AnchorPane tempPane = new AnchorPane();
tempPane.setPrefWidth(value);
tempPane.setPrefHeight(value);
tempPane.setBackground(Background.EMPTY);
return tempPane;
}
private Node getGapNode(double value) {
AnchorPane tempPane = new AnchorPane();
tempPane.setPrefWidth(value);
tempPane.setPrefHeight(value);
tempPane.setBackground(Background.EMPTY);
return tempPane;
}
@Override
public void start(Stage stage) throws Exception{
// 设置应用图标
ViewUtils.setWindowIcon(stage, ClassUtils.getResourceAsURL("res/white_icon/white_icon_Plus.png"));
// 无边框
ViewUtils.setNoBroder(stage);
// 设置标题
stage.setTitle("ApkToolPlus");
// 背景透明
stage.initStyle(StageStyle.TRANSPARENT);
// 设置透明度
//stage.setOpacity(0.8);
// 大小不可变
stage.setResizable(false);
// main ui
StackPane root = new StackPane();
AnchorPane layout = FXMLLoader.load(MainActivity.class.getResource("main.fxml"));
layout.setBackground(Background.EMPTY);
root.getChildren().add(layout);
// 设置根节点
Global.setRoot(root);
Scene scene = new Scene(root, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT, Color.TRANSPARENT);
stage.setScene(scene);
// test
// Loading loading = new Loading(ClassUtils.getResourceAsURL("res/gif/loading.gif"));
// loading.setMessage("正在加载,请稍候...");
// root.getChildren().add(loading);
// loading.lauchTimeoutTimer(2000);
// 在屏幕中间
stage.centerOnScreen();
// 设置拖拽事件
ViewUtils.registerDragEvent(stage,root);
stage.show();
// 恢复上次打开页面
Integer lastPageIndex = Integer.parseInt(Config.get(Config.kLastPageIndex, "0"));
MainActivity.getInstance().pages.setCurrentPageIndex(lastPageIndex);
}