Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7885531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:05:44+00:00 2026-06-03T05:05:44+00:00

@Override public void start(Stage primaryStage) { try { stage = primaryStage; gotoLogin(); primaryStage.show(); }

  • 0
@Override public void start(Stage primaryStage) {
        try {
            stage = primaryStage;
            gotoLogin();
            primaryStage.show();
        } catch (Exception ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    enter code here
    public User getLoggedUser() {
        return loggedUser;
    }

    public boolean userLogging(String userId, String password){
        if (Authenticator.validate(userId, password)) {
            loggedUser = User.of(userId);
            gotoProfile();
            return true;
        } else {
            return false;
        }
    }

    public void userLogout(){
        loggedUser = null;
        gotoLogin();
    }

    private void gotoProfile() {
        try {
            replaceSceneContent("../skinFolder/fxml/profile.fxml");
        } catch (Exception ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void gotoLogin() {
        try {
            replaceSceneContent("../skinFolder/fxml/login.fxml");
        } catch (Exception ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private Parent replaceSceneContent(String fxml) throws Exception {
        Parent page = (Parent) FXMLLoader.load(App.class.getResource(fxml), null, new JavaFXBuilderFactory());
        Scene scene = stage.getScene();
        if (scene == null) {
            scene = new Scene(page, 700, 450);
            scene.getStylesheets().add(App.class.getResource("../skinFolder/css/defaultSkin.css").toExternalForm());
            stage.setScene(scene);
        } else {
            stage.getScene().setRoot(page);
        }
        stage.sizeToScene();
        return page;
    }}

So i am trying to use the sample of the FXML Login example, only i give other way for the fxml. And in the fxml files i gave the way to the controller.

The log shows those errors:

at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at javafx.fxml.FXMLLoader.loadType(Unknown Source)
at javafx.fxml.FXMLLoader$ValueElement.processAttribute(Unknown Source)
at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(Unknown Source)
at javafx.fxml.FXMLLoader$Element.processStartElement(Unknown Source)
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at Main.App.replaceSceneContent(App.java:115)
at Main.App.gotoProfile(App.java:100)
at Main.App.userLogging(App.java:86)
at skinFolder.controllers.LoginController.processLogin(LoginController.java:28)

Login Controller Class

public class LoginController {
    @FXML private TextField userId;
    @FXML private PasswordField password;
    @FXML private Label errorMessage;

    @FXML protected void processLogin() {
        if(!App.getInstance().userLogging(userId.getText(), password.getText())){
            errorMessage.setText("Username/password combination is invalid.");
        }
    }
}

And the line 28 is:

if(!App.getInstance().userLogging(userId.getText(), password.getText())){

I mention that the fxml files are in another folder the Main file folder. I don’t get why i get this error when i am using the example gave by the Oracle, but with another folder structure!

My app folder structure:

  • Main
  • Model
  • Security
  • skinFolder – css
  • skinFolder – fxml
  • skinFolder – controllers

Here is the profile.fxml code:

<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.net.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?>

<AnchorPane id="Profile" styleClass="profile" xmlns:fx="http://javafx.com/fxml" fx:controller="skinFolder.controllers.ProfileController">
   <children>
    <Button maxHeight="2.0" text="Update" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="168.0" fx:id="update" onAction="#processUpdate"/>
    <Label layoutX="56.0" layoutY="77.0" text="Please review your profile data." fx:id="message" />
    <Label layoutX="56.0" layoutY="123.0" text="User:" />
    <Label layoutX="56.0" layoutY="224.0" text="Phone:" />
    <Label layoutX="56.0" layoutY="173.0" text="Email:" />
    <TextField editable="false" layoutX="149.0" layoutY="120.0" maxWidth="2.0" minHeight="30.0" minWidth="215.0" prefHeight="30.0" prefWidth="215.0" fx:id="user" />
    <TextField editable="true" layoutX="149.0" layoutY="171" maxWidth="2.0" minHeight="30.0" minWidth="215.0" prefHeight="30.0" prefWidth="215.0" fx:id="email" />
    <TextField layoutX="149.0" layoutY="224" maxWidth="2.0" minHeight="30.0" minWidth="215.0" prefHeight="30.0" prefWidth="215.0" fx:id="phone" />
    <CheckBox layoutX="402" layoutY="120.0" text="Subscribed to NewsLetter" fx:id="subscribed" />
    <Separator layoutX="380" layoutY="110" prefHeight="155" orientation="vertical"/>
    <Hyperlink layoutY="24.0" text="logout" AnchorPane.rightAnchor="52.0" fx:id="logout" onAction="#processLogout"/>
    <Button disable="true" maxHeight="2" maxWidth="2.0" text="Continue" defaultButton="true" AnchorPane.bottomAnchor="15.0" AnchorPane.rightAnchor="52.0" fx:id="Button" onAction="#processLogout"/>
    <Label layoutX="150.0" layoutY="401.0" opacity="0.0" text="Profile  successfully updated!" fx:id="success" />
    <Label layoutX="56.0" layoutY="284.0" text="Address:" />
    <TextArea maxHeight="2.0" maxWidth="2.0" minHeight="85.0" minWidth="448.0" prefHeight="85.0" prefWidth="448.0" AnchorPane.bottomAnchor="69.0" AnchorPane.leftAnchor="149.0" AnchorPane.rightAnchor="52.0" AnchorPane.topAnchor="289.0" fx:id="address" />
  </children>
  <styleClass>
    <String fx:value="profile" />
  </styleClass>
  <properties>
    <elementLockSel>
      <Boolean fx:value="true" />
    </elementLockSel>
  </properties>
</AnchorPane>

Anyone any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:05:46+00:00Added an answer on June 3, 2026 at 5:05 am

    I think it is related to your previous question (JavaFX 2.0 load fxml files from subfolder fails). See this answer. Same here for processUpdate action.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my thread: @Override public void run() { Log.d(ConnectionThread,Starting Server Connection); try {
public class CursorAtStartFocusListener extends FocusAdapter { @Override public void focusGained(java.awt.event.FocusEvent evt) { Object source
Thread thread = new Thread(new Runnable() { @Override public void run() { try {
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main2); savedInstanceState.putString(foo, bar); } @Override public void
@Override public void onCreate(SQLiteDatabase db) { db.execSQL(DATABASE_CREATE); // providers data // db.execSQL(insert into //
@Override public void onCancel() { // TODO Auto-generated method stub ERROR:The method onCancel() of
Code: outerMethod { @Override public void run() { innerMethod throws IOException } } Method
button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { db.update(); } }); On line
I have this code: @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { GLES20.glClearColor(0, 0,
I draw an arc using onDraw(canvas) : @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.