0% found this document useful (0 votes)
6 views1 page

5-Adding Functionality Transcript

The document outlines the steps to implement an exit functionality in a Java application using JavaFX. It details creating an 'exit program' method in the controller, linking it to an exit button in the UI, and ensuring the method is executed upon clicking the button. The document concludes by confirming that the application exits successfully when the exit button is clicked, and suggests moving on to adding task management features next.

Uploaded by

ptttam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

5-Adding Functionality Transcript

The document outlines the steps to implement an exit functionality in a Java application using JavaFX. It details creating an 'exit program' method in the controller, linking it to an exit button in the UI, and ensuring the method is executed upon clicking the button. The document concludes by confirming that the application exits successfully when the exit button is clicked, and suggests moving on to adding task management features next.

Uploaded by

ptttam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

But start adding some functionality to our application,

and we will start with simply a way to exit the application


when we click on the exit button.
So just to remind you, if you go to seeing builder, you have
the exit button.
So when this is click, your application should stop
and basically just exit.
So let's go to the controller and let's create a function
public void exit program in any function that is called
from the U Element will need to have an action, even argument.
A. Make sure that you used the Java effects start even action
event because a similar class is you are a class
with the same name is also present in java dot ada beauty.
When you double click on the action, even class, it will be
automatically added as an import to the controller.
Now let's call the even E and all really want to deal.
Is system got exit, but a status code that zero, which means
success.
It was successfully exit, Um and that's all we really need
to do. No.
How do we know that this function will be?
This method will be ah executed.
When when we click on the exit button.
Well, you'll need to create ah link between the U element and
dysfunction.
So first of all, go to fire and save all so that your changes
are saved.
Then go to sample dot XML and then click on the exit button
and in the court section in the court section off your right
great and being you will see on action and there'll be a drop
down menu here.
So if you click on this drop down, even see exit program and
you just need to select it.
So whenever this button is kicked, dysfunction is called.
If you don't see a drop down menu or if you don't see the
option of dysfunction in the ah drop down menu, then you need
to check two things you need to make sure that in the anchor
Pim, let me go to edit and soft wrap this so in view on self
crap this.
So make sure that you have the FX controller in the hanker
pain, and that FX controller is set to sample dot
controller, which is this class right here.
And second thing you want to check is that you have actually
saved all of your changes, right?
So if you have done that, give, you see this option on action
and you will see this drop down menu and you will see this
function, and that's what you need to select.
All right, So let's run our app and let's see if the changes
are actually reflected.
So they vehicle.
Nothing happens when we add task or delete task, but when we
kick on exit, the program exits.
So process finished with exit.
Good serum.
That's what we wanted.
Great. So let's continue on to the next task and create
functionality to add and delete tasks in our application.
And we'll also need a V to display those tasks here in the
list view.

You might also like