Now that we seen what is a JTheque Application, we’ll develop it, the first part of our program.
An application is basically a container for modules. It has a name, a version but adds no functionaly to the application, this a function of the modules. An application without modules is not useful and vice-versa.
An application is composed of several things :
- An XML file (application.xml) describing the application
- Some images (in the core/images folder)
- Eventually some .properties i18n files in the core/i18n folder
To define the internationalization values of the application, there is 2 ways. We can define the values directly in the XML file or use some i18n .properties files. This is this solution we will use in our case. The resource bundle must be named application and be in the core/i18n folder. Here are the files to create :
name=JTheque Demos author=Baptiste Wicht email@example.com
site=http://jtheque.developpez.com/en copyright=JTheque 2009 All rights reserved
site=http://jtheque.developpez.com/ copyright=JTheque 2009 Tous droits reservés
Then, we can write the application.xml file :
We declared than our application is available in french and in english. Moreover, we declare () to use the i18n files. i18n properties.
The core is translated in english, french and german.
For the images, we start to declare a logo.png file and a icon.png file for the application. We can use other extension specifying type=”jpg” for exemple for a .jpg file.
Here are the used images :
We will now make a first try. For that, you just have to launch the JTheque-Launcher.jar at the root of the JTheque folder. It will launch the core with our application.
Here is the result :
We can see that the application launches weel, but there is nothing really interesting to do in this application because there is no modules to add functionalities.