/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jira; import javafx.application.Application; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ContentDisplay; import javafx.scene.layout.Background; import javafx.scene.layout.BackgroundFill; import javafx.scene.layout.HBox; import javafx.scene.layout.Region; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.SVGPath; import javafx.stage.Stage; /** */ public class RT32837 extends Application { public static void main(String[] args) { launch(); } @Override public void start(Stage primaryStage) throws Exception { primaryStage.setScene(new Scene(createContent())); primaryStage.show(); } public Parent createContent() { Region r = new Region(); r.setPrefSize(30, 30); r.setBackground(new Background(new BackgroundFill(Color.RED, null, null))); r.setShape(new Circle(10)); r.setScaleShape(false); //button Button button = new Button(); button.setPrefSize(100, 100); String style = ""; style += "-fx-background-radius: 5 0 0 5, 5 0 0 5, 4 0 0 4, 3 0 0 3;"; style += "-fx-base: #58636a;"; style += "-fx-background: #58636a;"; style += "-fx-shadow-highlight-color: rgba(255,255,255,0.2);"; style += "-fx-padding: 5 10 5 10;"; style += "-fx-font-weight: bold;"; style += "-fx-text-fill: white;"; button.setStyle(style); button.setContentDisplay(ContentDisplay.GRAPHIC_ONLY); button.setPrefSize(30, 30); Region region = new Region(); // region.setPrefSize(100, 100); SVGPath shape = new SVGPath(); shape.setContent("M0,7L11,0L11,14Z"); region.setShape(shape); region.setScaleShape(false); region.setBackground(new Background(new BackgroundFill(Color.WHITE, null, null))); region.setStyle("-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.8) , 0 , 0 , 0 , -1 );"); button.setGraphic(region); return new HBox(r, button); } }