The first sample program with WindowBuilder Part II


Hi Guys. Last time we got to know the basic shop and some tools of our range. Today we will together program a program with which you can also protect your private applications from strangers. One or the other would have thought already and is aware that we also uploaded a similar program on our GitHub page a few weeks ago. Nevertheless, we would like to introduce you to programming with a simple example using WindowBuilder.


After we have started the development environment and created a project, we can create a window based on the palette, as shown on the picture above. The corresponding source code is manufactured by the WindowBuilder and differs from the variant which we have programmed Manuel without WindowBuilder.


Of course, anyone who has ever had to do with a computer, windows and the buttons and the buttons. These are the basic building blocks of user-friendly programming. We also explicitly posted a separate topic for these two topics. You are welcome to look up on the left side of the page on the tab.
Already at the introduction to object-oriented programming, we discussed the term "EVA". We also need exactly this principle here. With the principle of input, processing and output, all our programs will have to run.
The user is prompted to type in his username and personalized user password. Since the first case is only a text field, the user can see what he types as his username. However, for security reasons, the user can not see his password input and must be sure that he is typing correctly.
In order for the compiler to be able to process the inputs, this command must also be triggered somehow. How should the computer know that the user has completely entered his data.
In order to give the compiler the command to process and compare the data with the data in the database, we need to click on the "Login" button.
We notice that something is wrong. The program makes no point.
This is not a disadvantage, because we have not programmed how he should process the data that has been entered by the user.
In the source code which we have uploaded on GitHub, you can see that we have programmed a so-called action listener on the 77th line. This part of our source code is there to give the compiler the start to compare the inputs.



The button starts or starts the part in the program which ends the program and deletes it from the memory.
If the user enters his username and password three times incorrectly, the program will also be terminated and deleted from memory. After the user has entered his data correctly, it is welcomed with a nice greeting.


We have put together the complete range of WindowBuilder for you here. You are welcome to try and tinker yourself.
We will be releasing animations based on JavaFX in the next few days.

You can download here the Code of the application.

Kommentare

Beliebte Posts aus diesem Blog

How can I transform a .jar file to a .bat file?

Ein Kleines Spiel mit Altersabfrage

Zufallszahlen und Verzweigungen in Python