0

I'm trying to create simple login functionality for a Java / JavaFX project. I've assigned fx:id's 'txt_username' to the JFXTextField and 'txt_password' to the JFXPasswordField respectively. But the values that are being passed through are not the values in the input fields('admin' & 'password'):

values being passed

I have no idea how any help would be appreciated.

I quickly started a new project and with a simple form without using the JFoenix components and managed to get it working.

Imports:

import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXPasswordField;
import com.jfoenix.controls.JFXTextField;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.Window;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
  • We require these kind of questions to contain a [mcve] or at least enough code (posted as text, not as screenshot) to identify the issue. You've only posted the imports which are pretty irrelevant, unless you get a `ClassCastException` or `FXMLLoader` complains about field types and a screenshot taken when debugging the app (?)! Info about the way you access the text of the controls or any setup done in the controller that may cause issues are missing... – fabian May 04 '19 at 14:27
  • @DavidKC like fabian said we need a little more code That said did you do something like txt_username.getText() and set that value equal to some string like this String userNAME = txt_username.getText(); PS imports tell us very little ! – Vector Oct 13 '19 at 04:00

0 Answers0