Java Code Examples for javafx.scene.layout.AnchorPane#setBackground()

The following examples show how to use javafx.scene.layout.AnchorPane#setBackground() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ListNodePanel.java    From oim-fx with MIT License 6 votes vote down vote up
private Node getGapNode(double value) {
    AnchorPane tempPane = new AnchorPane();
    tempPane.setPrefWidth(value);
    tempPane.setPrefHeight(value);
    tempPane.setBackground(Background.EMPTY);
    return tempPane;
}
 
Example 2
Source File: HeadItem.java    From oim-fx with MIT License 6 votes vote down vote up
private Node getGapNode(double value) {
	AnchorPane tempPane = new AnchorPane();
	tempPane.setPrefWidth(value);
	tempPane.setPrefHeight(value);
	tempPane.setBackground(Background.EMPTY);
	return tempPane;
}
 
Example 3
Source File: MainFrame.java    From oim-fx with MIT License 5 votes vote down vote up
public Node getGapNode(double value) {
    AnchorPane pane = new AnchorPane();
    pane.setPrefWidth(value);
    pane.setPrefHeight(value);
    pane.setBackground(Background.EMPTY);
    return pane;
}
 
Example 4
Source File: TreeNode.java    From oim-fx with MIT License 5 votes vote down vote up
private Node getGapNode(double value) {
    AnchorPane tempPane = new AnchorPane();
    tempPane.setPrefWidth(value);
    tempPane.setPrefHeight(value);
    tempPane.setBackground(Background.EMPTY);
    return tempPane;
}
 
Example 5
Source File: FindGroupItem.java    From oim-fx with MIT License 5 votes vote down vote up
private Node getGapNode(double value) {
	AnchorPane tempPane = new AnchorPane();
	tempPane.setPrefWidth(value);
	tempPane.setPrefHeight(value);
	tempPane.setBackground(Background.EMPTY);
	return tempPane;
}
 
Example 6
Source File: FindUserItem.java    From oim-fx with MIT License 5 votes vote down vote up
private Node getGapNode(double value) {
	AnchorPane tempPane = new AnchorPane();
	tempPane.setPrefWidth(value);
	tempPane.setPrefHeight(value);
	tempPane.setBackground(Background.EMPTY);
	return tempPane;
}
 
Example 7
Source File: Main.java    From ApkToolPlus with Apache License 2.0 4 votes vote down vote up
@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);
    }