Step by step instructions for a JVx application |
The aim of this tutorial is to create an application with the Enterprise Application Framework – JVx. Moreover, a quick overview of the framework's possibilities will be given.
This documentation covers the following areas
Folder structureTo develop an application with JVx, a special folder structure is recommended. This simplifies the Build process and separates any dependencies between Client and Server. This structure is to be created as follows: can also be used on request. However, the documentation refers to the recommended structure.
Once the folder structure has been created, copy the library Project configurationOnce the configuration steps have been performed, a new project can be created with Eclipse:
The project is shown in Eclipse as follows: The Application developmentOn the server side, the application needs a configuration file for the settings that only concern the application. For the configuration of the server, an extra configuration file is needed. First we create the file for the application:
<?xml version="1.0" encoding="UTF-8"?>
The server configuration file must be stored in the folder
The configuration file can then be created:
<?xml version="1.0" encoding="UTF-8"?> The server does not need any special parameters for our application.
For the client, we now need a class of type package apps.firstapp;
It is now time for the first start of the application. To do so, we set up a Runtime configuration:
The application can now be started and looks as follows: The first login attempt fails with the following message Userfile 'users.xml' does not exist! This file was defined in the
We fill the file with the following: <?xml version="1.0" encoding="UTF-8"?> Any number of Now the login to the application works perfectly. However, to fulfill our task, we still need the possibility to display or edit a database table. We will now turn to this part of the task. Create a work screenBefore we create a WorkScreen, we prepare the application to display the WorkScreen. To do so, we extend our package apps.firstapp;
We now create the client class for our work screen:
and use the following Source Code package apps.firstapp.frames;
The WorkScreen is now ready and can be integrated in the application. We now implement the missing call: public class FirstApplication extends Application
The client implementation is now finished. Before we can use the application, we must create the missing server classes. We create the following classes:
package apps.firstapp;
package apps.firstapp;
package apps.firstapp.frames;
The application is now fully implemented and ready to run. So as to be able to work with the application, we need a database with the Create databaseThe following steps should take place to create and start a HyperSQL DB.
The first applicationOnce the database has been started, the application can also be started. The final application should look as follows: The Source Code and the Eclipse project can be found in the Download section. Contains application- and server-specific data
|