我在按鈕中使用SVG作爲圖像。但是我無法通過CSS爲它填充顏色。 以下是渲染按鈕的代碼。如何使用javaFX中的CSS設計SVG樣式FXML
<Button onAction="#closeApplication" >
<graphic>
<SVGPath content="M10,16 10,0 0,8z" styleClass="button‐icon‐shape" />
</graphic>
</Button>
這裏是CSS
.button-icon-shape SVGPath{
-fx-fill: red;
}