// add an icon to jbutton int width = 32; int height = 32; Image img = new Image(new File("path/to/icon.png").toURI().toString(), width, height, false, false); buttonTest.setGraphic(new ImageView(img));