Friday, February 24, 2012

Example of Java Swing desktop application without the JSR - 1


From NetBeans 7.1, Swing application framework (JSR) left being supported by NetBeans, and is no longer part of the official JDK (Java Development Kit).

So, in this article, and the next one, we'll make a small application with Swing classes without using the Swing application framework.

We will make use of the application layers previously developed in:

     - Example of Java Swing Application with Oracle Database – 1 (database creation)
     - Example of Java Swing Application with Oracle Database – 2 (HelperDB project for accessing the database)
     - Example of Java Swing Application with Oracle Database – 3 (librarySystemBLL project / BLL classes)

So, after creating the database, and having present projects HelperDB and librarySystemBLL, we will create a new project (librarySystemGUI) for the user interface.
Firstly, we will see how to import a project to NetBeans, having only the java sources developed in any IDE.


 Import previous projects to NetBeans 7.1

To import, in NetBeans 7.1, project HelperDB, we create a new project (with existing sources):



Here, we identify the folder where the Java sources are:



Confirm the included packages and source files:

And the new NetBeans project is obtained:

For these particular project, it is still needed to include the JAR files from Oracle to access the database:






For the librarySystemBLL project we proceed the same way. At the end, besides the JARs from ORACLE, it is also needed to include the HelperDB project in the libraries.


We are now in condition to create the graphical user interface (GUI) project, which will be treated in the next article.

Related articles:
     - Example of Java Swing Application with Oracle Database – 1
     - Example of Java Swing Application with Oracle Database – 2
     - Example of Java Swing Application with Oracle Database – 3



No comments:

Post a Comment