I am using javaFX. I made a button and set the image for this. the code:
Image playI=new Image("file:///c:/Users/Farhad/Desktop/icons/play2.jpg");
ImageView iv1=new ImageView(playI);
iv1.setFitHeight(67);
iv1.setFitWidth(69);
Button playB=new Button("",iv1);
But I want, when I press the button, the image will change to another image. How can i do this?
source
share