Java Code Examples for javafx.scene.control.Button.setManaged()

The following are Jave code examples for showing how to use setManaged() of the javafx.scene.control.Button class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: PhotoScript   File: GraphicBoard.java   Source Code and License Vote up 5 votes
private void showSvgs(int index) {
    int x = 0, y = 0;
    for (String j :
            svgData.get(index).getValue().getData().values()) {
        SVGPath path = new SVGPath();
        path.setContent(j);
        Bounds bounds = path.boundsInLocalProperty().getValue();
        double scale = Math.max(bounds.getHeight(),bounds.getWidth());
        path.setScaleX(30 / scale);
        path.setScaleY(30 / scale);
        Button button = new Button();
        button.setGraphic(path);
        button.getStylesheets().add("css/svgbutton_style.css");
        button.setOnMouseClicked(event -> {
            SVGPath svgPath = (SVGPath) button.getGraphic();
            controller.drawSvg(svgPath.getContent());
            (button.getScene().getWindow()).hide();
        });
        button.setManaged(false);
        button.resizeRelocate(x , y, 50, 50);
        x+=55;
        if (x > 399) {
            x = 0;
            y += 55;
        }
        iconsPane.getChildren().add(button);
    }
}