A graphical user interface has to start with a top-level container. It provides a home for the other components of the interface, and dictates the overall feel of the application. In this tutorial, you will be introduced to the JFrame class. It will be used to create a simple top-level window for a Java application.
Open your editor to start a new text file, and type in the following:
import java.awt.*;
import javax.swing.*;
Java comes with a set of code libraries that are designed to help programmers. They provide access to classes that perform specific functions, to save you the bother of having to write them yourself. The two import statements above, let the compiler know that the application wants to use some of the pre-built functionality contained within the "AWT" and "Swing" code libraries.
AWT stands for “Abstract Window Toolkit”. It contains classes that programmers can use to make graphical components, e.g., buttons, labels, frames. Swing is built on top of AWT, and provides a new set of more sophisticated graphical interface components. With just two lines of code, we gain access to these graphical components, and can use them in the Java application.
Source:
http://java.about.com/od/creatinguserinterfaces/ss/simplewindow.htm
Open your editor to start a new text file, and type in the following:
import java.awt.*;
import javax.swing.*;
Java comes with a set of code libraries that are designed to help programmers. They provide access to classes that perform specific functions, to save you the bother of having to write them yourself. The two import statements above, let the compiler know that the application wants to use some of the pre-built functionality contained within the "AWT" and "Swing" code libraries.
AWT stands for “Abstract Window Toolkit”. It contains classes that programmers can use to make graphical components, e.g., buttons, labels, frames. Swing is built on top of AWT, and provides a new set of more sophisticated graphical interface components. With just two lines of code, we gain access to these graphical components, and can use them in the Java application.
Source:
http://java.about.com/od/creatinguserinterfaces/ss/simplewindow.htm
Search News
News Categories
What's the News?
Post a link to something interesting from another site, or submit your own original writing for the Java community to read.
Most Popular News
-
How to stand out from other Java/JEE Professionals?
Published about 14-01-2009 | Rated +3 -
10 reasons IT certification will be important in 2009
Published about 05-01-2009 | Rated +2 -
The 9 hottest skills for `09
Published about 02-01-2009 | Rated +1 -
New Features in Servlets 3.0
Published about 05-01-2009 | Rated +4
Most Recent User Submitted News
- Good News for Java Developers in a Tight Economy
Published about 01-05-2009 | Rated +1 - 10 Things You Should Know About WebLogic Server 10.3
Published about 30-05-2009 | Rated +1 - What is the use of java?
Published about 13-05-2009 | Rated +1 - Update SVN to GITHUB
Submitted by Archana | Rated 0







