The following code should create a button with a mitered border similar to the inset border style seen here: http://www.w3schools.com/cssref/playit.asp?filename=playcss_border-style&preval=inset
button.setStyle("-fx-background-color: null; -fx-border-width: 5; -fx-border-color: black grey grey black; -fx-border-style: solid line-join miter 45;");
However the line-join does not work as expected as the joins end up square rather than mitered.
Refer to https://forums.oracle.com/forums/thread.jspa?threadID=2333665 for a related discussion.
Sample test program:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.*;
import javafx.stage.Stage;
public class MiteredButtonStyle extends Application {
public static void main(String[] args) throws Exception { launch(args); }
public void start(final Stage stage) throws Exception {
Button button = new Button("My lines-joins are square, not mitered");
button.setStyle("-fx-background-color: null; -fx-border-width: 5; -fx-border-color: black grey grey black; -fx-border-style: solid line-join miter 45;");
stage.setScene(new Scene(VBoxBuilder.create().spacing(10).children(button).style("-fx-background-color: azure; -fx-padding: 20; -fx-font-size:20;").build()));
stage.show();
}
}
button.setStyle("-fx-background-color: null; -fx-border-width: 5; -fx-border-color: black grey grey black; -fx-border-style: solid line-join miter 45;");
However the line-join does not work as expected as the joins end up square rather than mitered.
Refer to https://forums.oracle.com/forums/thread.jspa?threadID=2333665 for a related discussion.
Sample test program:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.*;
import javafx.stage.Stage;
public class MiteredButtonStyle extends Application {
public static void main(String[] args) throws Exception { launch(args); }
public void start(final Stage stage) throws Exception {
Button button = new Button("My lines-joins are square, not mitered");
button.setStyle("-fx-background-color: null; -fx-border-width: 5; -fx-border-color: black grey grey black; -fx-border-style: solid line-join miter 45;");
stage.setScene(new Scene(VBoxBuilder.create().spacing(10).children(button).style("-fx-background-color: azure; -fx-padding: 20; -fx-font-size:20;").build()));
stage.show();
}
}