Saturday, March 3, 2012

Example of Java Swing desktop application without the JSR - 2

In this article we are going to create a Java Swing-based GUI project to complement the ones we previously made, and whose developments are addressed in:
     - 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
     - Example of Java Swing desktop application without the JSR - 1

In NetBeans 7.1, we need to create a Java Application Project:




A Java Application Project automatically creates a class with method main().
We really don't need that class, because we are going to create a JFrame, which automatically creates a main() method that launches it and makes the frame visible.

Anyway, and before creating the JFrame, let's add the needed references to our new project. We need to add, in the project libraries, references to projects HelperDB and librarySystemBLL. References to "ojdbc" jars that come with Oracle XE also need to be added, just like we did before in the other two projects.


Now, let's create the JFrame, that will be the application's main window: