I am writing a \"Star Trek\" game for fun with Java/JavaFX. My idea is that the main game screen is an 10x10 GridPane of Buttons. All the game pieces (the Enterprise, Klingons
btnTest.setMinSize(55, 37);
btnTest.setMaxSize(55, 37);
Image image = new Image("/view/images/someImage.png", btnTest.getWidth(), btnTest.getHeight(), false, true, true);
BackgroundImage bImage = new BackgroundImage(image, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, new BackgroundSize(btnTest.getWidth(), btnTest.getHeight(), true, true, true, false));
Background backGround = new Background(bImage);
btnTest.setBackground(backGround);
See https://docs.oracle.com/javase/8/javafx/api/javafx/scene/layout/Background.html