Issue
I am new to JavaFX and SceneBuilder. I created an app using the SceneBuilder in Eclipse. (Right click FXML file > open with SceneBuilder) Inside initialize method, I can not see the setOnAction method.
package application.controller;
import com.jfoenix.controls.JFXPasswordField;
import com.jfoenix.controls.JFXTextField;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.scene.image.ImageView;
public class controller {
@FXML
private ResourceBundle resources;
@FXML
private URL location;
@FXML
private JFXTextField loginID;
@FXML
private JFXPasswordField passwordID;
@FXML
private ImageView loginButton;
@FXML
public void initialize() {
loginButton.setona
}
}
Solution
You defined loginButton
as an ImageView
. ImageView
does not have setOnAction
method. use setOnMouseClicked
instead.
Answered By - Messaoud Zahi