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:
Showing posts with label Java Swing. Show all posts
Showing posts with label Java Swing. Show all posts
Saturday, March 3, 2012
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.
Thursday, February 23, 2012
Swing-based desktop applications after NetBeans 7.1
In the 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
- Example of Java Swing Application with Oracle Database – 4
we developed a small example application, for desktop, using Java/JavaSwing.
For that we used NetBeans IDE, and created a project of type Java Desktop Application for the user interface.
Since NetBeans 7.1, however, Swing application framework is no longer supported by NetBeans, and stopped being part of the official JDK (Java Development Kit). In fact, in NetBeans 7.0.1, the following message already appeared every time one created a Java Desktop Application project:
In NetBeans 7.1 we have, at least, two alternatives:
- 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 Application with Oracle Database – 4
we developed a small example application, for desktop, using Java/JavaSwing.
For that we used NetBeans IDE, and created a project of type Java Desktop Application for the user interface.
Since NetBeans 7.1, however, Swing application framework is no longer supported by NetBeans, and stopped being part of the official JDK (Java Development Kit). In fact, in NetBeans 7.0.1, the following message already appeared every time one created a Java Desktop Application project:
In NetBeans 7.1 we have, at least, two alternatives:
- To create an application from scratch, or
- To create a project of type Netbeans Platform Application
Tuesday, February 7, 2012
Example of Java Swing Application with Oracle Database – 4
In this article we're going to develop the presentation layer of our software application. This layer is also know as User Interface or Graphical User Interface Layer.
In blog entry Example of Java Swing Application with Oracle Database - 1, the first one of this series, we've handled the Oracle database creation. In the 2nd article a database access package has been created, HelperDB. The 3rd article addressed the creation of a class library at the level of business logic layer and data access layer.
This article addresses the construction of the user interface project (GUI - Graphical User Interface) using Java Swing classes. To do that, we need to create a new Net Beans project, which we will name LibrarySystem:
This project must be a Java Desktop Application. This kind of project supplies a template with the basic infrastructure of a desktop application, such as a main window with a menu bar and a status bar.
Then, we select Basic Application (the other type, Database Application, will be treated in another series of articles).
This kind of project creates beforehand 3 classes:
- LibrarySystemApp.java - this is the application's main class. The main method will launch the main window. From there, the whole application will be event-driven.
In blog entry Example of Java Swing Application with Oracle Database - 1, the first one of this series, we've handled the Oracle database creation. In the 2nd article a database access package has been created, HelperDB. The 3rd article addressed the creation of a class library at the level of business logic layer and data access layer.
This article addresses the construction of the user interface project (GUI - Graphical User Interface) using Java Swing classes. To do that, we need to create a new Net Beans project, which we will name LibrarySystem:
This project must be a Java Desktop Application. This kind of project supplies a template with the basic infrastructure of a desktop application, such as a main window with a menu bar and a status bar.
Then, we select Basic Application (the other type, Database Application, will be treated in another series of articles).
This kind of project creates beforehand 3 classes:
- LibrarySystemApp.java - this is the application's main class. The main method will launch the main window. From there, the whole application will be event-driven.
Subscribe to:
Posts (Atom)