2

A few weeks ago, after having learnt the basics of Java, I found JavaFX. I thought it'd be very useful, as simply, I dislike making applications using JFrame. It's just so limited and complicated in my opinion.

I'm making the .fxml files using SceneBuilder, and I'm coding the actual thing in Eclipse. I make sure to reload the project after I edit a file in SceneBuilder, and I occasionally test the program after I make changes.

I've run into the following error: http://pastebin.com/n99ccdiB

My Controller Class (in the proper location..): http://pastebin.com/LfhWbP70

My .fxml File: http:// pastebin.com/YsV8EkcD

Does anyone know how to fix this? It's the only thing giving me an error, and it's quite frustrating.. Note that there are no mistakes in the WindowHandler and DatabaseHandler classes, and they work fine with other things.

2 Answers 2

7

Also, when I try to do so, it gives me a warning: "Parameter 'event' is not assignable to javafx.event.Event"

So, there's your problem. You have the wrong import in your Controller: you have the java.awt.event.ActionEvent instead of the JavaFX ActionEvent.

Sign up to request clarification or add additional context in comments.

2 Comments

Haha, I would've never found that myself. Thanks!
I still get that warning on my method, even though I have the correct import (javafx.event.ActionEvent) and have the @FXML annotation.
0

Try adding a @FXML tag before the method just as you did with the instance variables of the controller.

1 Comment

Never did that to any of my handlers in any of my classes, and they all work fine. Also, when I try to do so, it gives me a warning: "Parameter 'event' is not assignable to javafx.event.Event"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.