Olá pessoal aparentemente estou tento problema para o Scene builder ver meu package controller, arquivo: LoginVerification.java e ja olhei o caminho e a principio não aparenta ser a causa raiz do problema.OBS: o meu sistema operacional é o kali caso isso ajude e estou na IDE VS CODE e sim ja tentei no eclipse mas dai piorou ate pra instalar.
Segue o codigo abaixo:
login.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.effect.ColorAdjust?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="516.0" prefWidth="327.0" style="-fx-background-color: PURPLE; -fx-border-color: BLACK; -fx-border-width: 7;" stylesheets="@src/main/java/login/css/Login.css" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greentech.login.controller">
<children>
<ImageView fitHeight="130.0" fitWidth="140.0" layoutX="94.0" layoutY="50.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../img/greentechlogo_LoginArea.png" />
</image>
<effect>
<ColorAdjust contrast="-0.13" hue="-1.0" />
</effect>
</ImageView>
<Line endX="69.0" layoutX="163.0" layoutY="190.0" startX="-69.0" />
<Line endX="100.0" layoutX="164.0" layoutY="213.0" startX="-100.0" />
<Text fill="WHITE" fontSmoothingType="LCD" layoutX="93.0" layoutY="207.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Smart Solutions">
<font>
<Font name="System Italic" size="17.0" />
</font>
</Text>
<Pane layoutX="64.0" layoutY="247.0" prefHeight="226.0" prefWidth="200.0" style="-fx-background-color: WHITE;" stylesheets="@src/main/java/login/css/Login.css">
<children>
<TextField fx:id="user" layoutX="15.0" layoutY="47.0" />
<Text layoutX="15.0" layoutY="43.0" strokeType="OUTSIDE" strokeWidth="0.0" text="ID/Login" wrappingWidth="71.5234375" />
<TextField fx:id="password" layoutX="15.0" layoutY="113.0" />
<Text layoutX="15.0" layoutY="109.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Password" wrappingWidth="94.5234375" />
<Button fx:id="submit" layoutX="54.0" layoutY="165.0" mnemonicParsing="false" onAction="#submit" prefHeight="24.0" prefWidth="85.0" stylesheets="@../styles/Styles.css" text="Login" />
<Label fx:id="errorLabel" layoutX="19.0" layoutY="14.0" prefHeight="16.0" prefWidth="162.0" textFill="RED" />
</children>
</Pane>
</children>
</AnchorPane>
loginverification:
package greentech.login.controller;
import java.lang.reflect.Array;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
public class LoginVerification {
@FXML
private TextField user;
@FXML
private TextField password;
@FXML
private Label errorLabel;
@FXML
private Button submit;
String userValue;
String passValue;
//teste de login com usuario ficticio
String users[] = {"adm", "comun", "teste", "adm2"};
String passwords[] = {"123", "456", "!@#", "abc"};
// Pega o valor dos campos preenchidos na tela de login e
// usa a funcao verifica para ver se correspondem e segue para a proxima tela
// se não aprecera uma tela de erro
@FXML
void submit(ActionEvent event) {
userValue = user.getText();
passValue = user.getText();
verifica(userValue, passValue);
}
public void verifica(String usuario, String senha){
for(int i = 0; i < users.length; i++){
if(userValue == users[i] && passValue == passwords[i]){
} else{
errorLabel.setText("Usuario e/ou senha errado");
}
}
}
}