I'm trying to add a border to my Image/ImageView, but I don't know how to do it.
When I press the button three randomly generated images are added to the GridPane. I've tried adding -fx-border-color and -fx-border-width properties through an external CSS file and then applying it but that way hasn't worked.
Any help is appreciated!
btnLever.setOnAction((ActionEvent e) ->
{
// New array for loading in the images from 'generateImages' method
String[] fruits = new String[3];
fruits = generateImages();
// GAME WILL RUN IF THE CREDITS IS GREATER THAN 0
if(credits >0)
{
// IMAGES GENERATED
Image img1 = new Image(fruits[0]);
Image img2 = new Image(fruits[1]);
Image img3 = new Image(fruits[2]);
// ADDS IMAGES TO THE GRID
grid.add(new ImageView(img1), 0, 0);
grid.add(new ImageView(img2), 1, 0);
grid.add(new ImageView(img3), 2, 0);