I'm creating a Solitaire game using JavaFX. The fxml contains the layout for the game. I am using imageviews in buttons to display playing cards, such that my fxml code is the following:
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.KlondikeController">
<children>
<ImageView fitHeight="720.0" fitWidth="1280.0">
<image>
<Image url="@../images/KlondikeBackground.png" />
</image>
</ImageView>
<Button fx:id="TestButton" layoutX="100.0" layoutY="100.0" mnemonicParsing="false" onAction="#TestClicked" prefHeight="50.0" prefWidth="30.0" contentDisplay="CENTER">
<graphic>
<ImageView fx:id="buttonImage" fitHeight="200.0" fitWidth="150.0">
<Image url="@../images/10c.png"/>
</ImageView>
</graphic>
</Button>
</children>
</AnchorPane>
Unfortunately, when a card displays in the UI, there's a border around the card image (see picture). Could anybody tell me how to get rid of it?