Jump to content

Unable to use setOnAction event on javafx component


Recommended Posts


package application.controller;
import com.jfoenix.controls.JFXButton;
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.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.event.ActionEvent;

public class LoginController {

    private ResourceBundle resources;

    private URL location;

    private AnchorPane mainContainer;

    private AnchorPane loginContainer;

    private Label label;

    private JFXTextField userName;

    private JFXPasswordField password;

    private JFXButton loginButton;

    void initialize() {
loginButton // pressing dot after loginButton does not display setOnAction event

How can I use the setOnAction event for the loginButton?


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...