After creating the FXML structure below, I attempted to define a border in CSS for the Image by using code in the customerform.css file:
<VBox id="customerFormPane" styleClass="customerForm" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.customer.CustomerFormController" >
<stylesheets>
<URL value="@customerform.css"/>
</stylesheets>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" percentWidth="50.0"/>
<ColumnConstraints hgrow="ALWAYS" percentWidth="50.0"/>
</columnConstraints>
<ImageView id="boxImage" fitWidth="100" fitHeight="100">
<image>
<Image url="@/com/exmaple/resources/icons/office.png" />
</image>
</ImageView>
</GridPane>
</VBox>
.customerForm Image, .customerForm ImageView, .customerForm image {
-fx-background-color: white;
-fx-border-style: solid;
-fx-border-color: red;
}
Despite having the image displayed correctly, my attempts did not render any visible border on the ImageView. Does anyone have any suggestions on how to successfully select and style the ImageView element?