buttonjavafxelementspacing

set spacing among elements within button javafx


I want to specify spacing between two elements within JavaFX Buttons, Here is the Code :

    ImageView fiv = new ImageView(new Image("/modified/map.png"));
    fiv.setFitHeight(20);
    fiv.setPreserveRatio(true);

    Button cr = new Button( "Crop", fiv);

Here I want to Specify Spacing Between "Crop" and fiv, How can i do this ?


Solution

  • Use graphicTextGap property of the button.