Trace: • Features • First JVx Application (Step by Step)
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
jvx:firstapp_step-by-step [2021/03/22 14:09] admin |
jvx:firstapp_step-by-step [2024/11/18 10:15] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~Title: First JVx Application (Step by Step)~~ | ~~Title: First JVx Application (Step by Step)~~ | ||
- | The aim of this tutorial is to create an application with the Enterprise Application Framework – [[https://jvx.sibvisions.com|JVx]]. Moreover, a quick overview of the framework's possibilities will be given. | + | The aim of this tutorial is to create an application with the Enterprise Application Framework. Moreover, a quick overview of the framework's possibilities will be given. |
The application's task is to display the data from a database table and make them editable. The application requests authentication with username and password. | The application's task is to display the data from a database table and make them editable. The application requests authentication with username and password. | ||
Line 9: | Line 9: | ||
* [[http://sourceforge.net/projects/jvx/files/latest/download|JVx Binary package]] | * [[http://sourceforge.net/projects/jvx/files/latest/download|JVx Binary package]] | ||
* Eclipse IDE (>= 3.4) with JDT (recommended: Eclipse IDE for Java EE developers) | * Eclipse IDE (>= 3.4) with JDT (recommended: Eclipse IDE for Java EE developers) | ||
- | * JDK 6.0 (1.6) or higher | + | * JDK 8.0 (1.8) or higher |
* HSQLDB library (http://www.hsqldb.org) | * HSQLDB library (http://www.hsqldb.org) | ||
- | * [[https://search.maven.org/artifact/org.swinglabs.swingx/swingx-all/1.6.4/jar|SwingX]] lib | ||
* Database and SQL skills | * Database and SQL skills | ||
Line 57: | Line 56: | ||
* Note that the project has to be set up in the application folder ''firstapp'' \\ {{:jvx:newproject.png?nolink|}} | * Note that the project has to be set up in the application folder ''firstapp'' \\ {{:jvx:newproject.png?nolink|}} | ||
* **Remove** the ''src'' folder from the **Source Folders** \\ **Set** the folders ''src.client'', ''src.server'' and ''test'' as **Source Folder** \\ {{:jvx:newproject_folders.png?nolink|}} | * **Remove** the ''src'' folder from the **Source Folders** \\ **Set** the folders ''src.client'', ''src.server'' and ''test'' as **Source Folder** \\ {{:jvx:newproject_folders.png?nolink|}} | ||
- | * **Add** the ''jvx.jar'' library, from the project directory ''JVxFirstApp/libs/server'' \\ **Add** the ''swingx-all-1.6.4.jar'' library, from the project directory ''JVxFirstApp/libs/client'' \\ {{:jvx:newproject_libs.png?nolink|}} | + | * **Add** the ''jvx.jar'' library, from the project directory ''JVxFirstApp/libs/server'' \\ {{:jvx:newproject_libs.png?nolink|}} |
* The project can now be created | * The project can now be created | ||
Line 115: | Line 114: | ||
</server> | </server> | ||
</file> | </file> | ||
- | The server does not need any special parameters for our application. \\ \\ For the client, we now need a class of type ''javax.rad.application.IApplication''. A standard implementation of JVx is implemented via ''com.sibvisions.rad.application.Application''. We then derive our client from it and thereby create a class in the directory ''src.client'' with the following source code: | + | The server does not need any special parameters for our application. \\ \\ For the client, we now need a class of type ''jvx.rad.application.IApplication''. A standard implementation of JVx is implemented via ''com.sibvisions.rad.application.Application''. We then derive our client from it and thereby create a class in the directory ''src.client'' with the following source code: |
<file java FirstApplication.java> | <file java FirstApplication.java> | ||
package apps.firstapp; | package apps.firstapp; | ||
- | import javax.rad.application.genui.UILauncher; | + | import jvx.rad.application.genui.UILauncher; |
- | import javax.rad.remote.IConnection; | + | import jvx.rad.remote.IConnection; |
import com.sibvisions.rad.application.Application; | import com.sibvisions.rad.application.Application; | ||
Line 128: | Line 127: | ||
/** | /** | ||
* First application with JVx, Enterprise Application Framework. | * First application with JVx, Enterprise Application Framework. | ||
- | * <p/> | + | * |
* @author René Jahn | * @author René Jahn | ||
*/ | */ | ||
Line 140: | Line 139: | ||
* Creates a new instance of <code>FirstApplication</code> with a technology | * Creates a new instance of <code>FirstApplication</code> with a technology | ||
* dependent launcher. | * dependent launcher. | ||
- | * <p/> | + | * |
* @param pLauncher the technology dependent launcher | * @param pLauncher the technology dependent launcher | ||
+ | * @throws Exception if initialization fails | ||
*/ | */ | ||
- | public FirstApplication(UILauncher pLauncher) | + | public FirstApplication(UILauncher pLauncher) throws Exception |
{ | { | ||
super(pLauncher); | super(pLauncher); | ||
Line 219: | Line 219: | ||
package apps.firstapp; | package apps.firstapp; | ||
- | import javax.rad.application.genui.UILauncher; | + | import jvx.rad.application.genui.UILauncher; |
- | import javax.rad.genui.UIImage; | + | import jvx.rad.genui.UIImage; |
- | import javax.rad.genui.component.UIButton; | + | import jvx.rad.genui.component.UIButton; |
- | import javax.rad.genui.container.UIToolBar; | + | import jvx.rad.genui.container.UIToolBar; |
- | import javax.rad.genui.menu.UIMenu; | + | import jvx.rad.genui.menu.UIMenu; |
- | import javax.rad.genui.menu.UIMenuItem; | + | import jvx.rad.genui.menu.UIMenuItem; |
- | import javax.rad.remote.IConnection; | + | import jvx.rad.remote.IConnection; |
import com.sibvisions.rad.application.Application; | import com.sibvisions.rad.application.Application; | ||
Line 232: | Line 232: | ||
/** | /** | ||
* First application with JVx, Enterprise Application Framework. | * First application with JVx, Enterprise Application Framework. | ||
- | * <p/> | + | * |
* @author René Jahn | * @author René Jahn | ||
*/ | */ | ||
Line 244: | Line 244: | ||
* Creates a new instance of <code>FirstApplication</code> with a technology | * Creates a new instance of <code>FirstApplication</code> with a technology | ||
* dependent launcher. | * dependent launcher. | ||
- | * <p/> | + | * |
* @param pLauncher the technology dependent launcher | * @param pLauncher the technology dependent launcher | ||
*/ | */ | ||
Line 340: | Line 340: | ||
package apps.firstapp.frames; | package apps.firstapp.frames; | ||
- | import javax.rad.genui.container.UIGroupPanel; | + | import jvx.rad.genui.container.UIGroupPanel; |
- | import javax.rad.genui.container.UIInternalFrame; | + | import jvx.rad.genui.container.UIInternalFrame; |
- | import javax.rad.genui.control.UITable; | + | import jvx.rad.genui.control.UITable; |
- | import javax.rad.genui.layout.UIBorderLayout; | + | import jvx.rad.genui.layout.UIBorderLayout; |
- | import javax.rad.remote.AbstractConnection; | + | import jvx.rad.remote.AbstractConnection; |
- | import javax.rad.remote.MasterConnection; | + | import jvx.rad.remote.MasterConnection; |
import com.sibvisions.rad.application.Application; | import com.sibvisions.rad.application.Application; | ||
Line 353: | Line 353: | ||
/** | /** | ||
* A simple database table editor. | * A simple database table editor. | ||
- | * <p/> | + | * |
* @author René Jahn | * @author René Jahn | ||
*/ | */ | ||
Line 380: | Line 380: | ||
/** | /** | ||
* Creates a new instance of DBEditFrame for a specific application. | * Creates a new instance of DBEditFrame for a specific application. | ||
- | * <p/> | + | * |
* @param pApp the application | * @param pApp the application | ||
* @throws Throwable if the remote access fails | * @throws Throwable if the remote access fails | ||
Line 396: | Line 396: | ||
/** | /** | ||
* Initializes the model. | * Initializes the model. | ||
- | * <p/> | + | * |
* @throws Throwable if the initialization throws an error | * @throws Throwable if the initialization throws an error | ||
*/ | */ | ||
Line 418: | Line 418: | ||
/** | /** | ||
* Initializes the UI. | * Initializes the UI. | ||
- | * <p/> | + | * |
* @throws Exception if the initialization throws an error | * @throws Exception if the initialization throws an error | ||
*/ | */ | ||
Line 490: | Line 490: | ||
/** | /** | ||
* Opens the edit screen. | * Opens the edit screen. | ||
- | * <p/> | + | * |
* @throws Throwable if the edit frame can not be opened | * @throws Throwable if the edit frame can not be opened | ||
*/ | */ | ||
Line 520: | Line 520: | ||
/** | /** | ||
* The LCO for the application. | * The LCO for the application. | ||
- | * <p/> | + | * |
* @author René Jahn | * @author René Jahn | ||
*/ | */ | ||
Line 542: | Line 542: | ||
/** | /** | ||
* The LCO for the session. | * The LCO for the session. | ||
- | * <p/> | + | * |
* @author René Jahn | * @author René Jahn | ||
*/ | */ | ||
Line 590: | Line 590: | ||
package apps.firstapp.frames; | package apps.firstapp.frames; | ||
- | import javax.rad.persist.IStorage; | + | import jvx.rad.persist.IStorage; |
import com.sibvisions.rad.persist.jdbc.DBStorage; | import com.sibvisions.rad.persist.jdbc.DBStorage; | ||
Line 598: | Line 598: | ||
/** | /** | ||
* The LCO for the DBEdit WorkScreen. | * The LCO for the DBEdit WorkScreen. | ||
- | * <p/> | + | * |
* @author René Jahn | * @author René Jahn | ||
*/ | */ | ||
Line 646: | Line 646: | ||
The following steps should take place to create and start a HyperSQL DB. | The following steps should take place to create and start a HyperSQL DB. | ||
- | * Copy the HyperSQL JDBC-Driver (hsqldb.jar) to the directory \\ ''../JVxFirstApp/libs/server/' | + | * Copy the HyperSQL JDBC-Driver (''hsqldb.jar'') to the directory ''../JVxFirstApp/libs/server/'' |
* Add the JDBC-Driver to the CLASSPATH of the JVxFirstApp Project | * Add the JDBC-Driver to the CLASSPATH of the JVxFirstApp Project | ||
* Create a database with the alias firstappdb and the following table: \\ <file sql>create table CONTACTS | * Create a database with the alias firstappdb and the following table: \\ <file sql>create table CONTACTS |