0
Javafx
Hey,any body who can help me to put an image to my button on javafx Image image=new Image(getclass().getResource())…doesn't work
2 Respuestas
+ 1
The constructor of Image expects either an InpustStream or a String (URL).
Your parameter is neither. You probably missed something in front of .getClass.
0
these might help you
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;