13.1 JavaFX
Cliquez içi pour plus de vidéos disponibles sur notre chaine youtube !Hello everyone, in this section we will work on the javaFX application. Java applications can have graphical user interfaces that contain buttons, lists, checkboxes, menus, toolbars and many other controls that allow users to interact with applications. Javafx is a set of APIs that we use to build java user interfaces. So you can use javafx to develop the user interface for desktop, web and mobile applications. But in this course, we will focus on desktop applications. I will create a javaFx project So I will click on «new project» and then on JavaFx, . as name «HelloWorldFX» Then on "Next" no need for dependencies Click on "Finish". Now we have our application which is already well configured I will click on "run" to test the application So, we have our in mind which is "hello world" This is the one, I can change it to what I want for example "Hello" and then here we have the button, for now we don’t need it, so I can delete it. It’s in the Controller and fxml files. So let’s start talking more about javaFx.. So javafx was designed with the MVC method. or Model-View-Controller. In a word, this model maintains the code that manages the data of an application separately from the code of the user interface. For this reason, when using the MVC model you should not mix the code that deals with the user interface and the code that handles the application data in the same class.The controller is in a way an intermediary between the user interface and the data. Now, when you work with javaFx the model matches the data model of the application, the view is the fxml file and the controller is the code that determines what happens when a user interacts with the user interface. But javaFx does not really apply the MVC model, but it is a good practice to follow. We’re going to stop here and we’re going to continue in the next video Go! I’ll tell you next time.