Coding Fun Java Java Tutorial 53 (JavaFX / GUI) – Button with Event Handler

Java Tutorial 53 (JavaFX / GUI) – Button with Event Handler

After watching this tutorial, you will know how to use event handler for a single button in three different ways. The first method is implementing the EventHandler interface to the whole class and make a whole method in the main class. The second way is using the anonymous inner class. The third way is using the lambda expression.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

9 thoughts on “Java Tutorial 53 (JavaFX / GUI) – Button with Event Handler”

  1. Eric Schach says:

    Thanks man, that really helped me out a lot. The only tutorial that was usefull for me.

  2. Daiz7788 says:

    What if you have different colored buttons and you want which ever color is clicked on to be pushed into a stack? The stack methods are in a different class called Stack.

  3. You give a very nice explanation nice tutorial

  4. Oskar Lange says:

    Hey Master. Could You tell me how to correctly connect controller to main class without fxml file. I'm just gonna build simple Pane with buttons and textfields in clean java (main class) without using fxml file. After that I would like to use EventHandler and react for events (for example: clicking button) in controller. So, my question is how to build Pane with buttons, textfields and labels in main class (without FXML) and use EventHandler in controller? How to do that. Any ideas. Can you send me some exemplary code. I'll give you my email address. Best regards.

  5. Wolf says:

    or you can just just update to JDK 8 and use lambda, way easier

  6. PLZ UPLOAD OTHER JAVA VIDEOS .. it will be to helpful

  7. dony kisworo says:

    thank's for your tutorial. I want to know how enable or disable button from another windows form?

Leave a Reply

Your email address will not be published. Required fields are marked *