Tutorial 4 - Windows Programming

In this tutorial, basic Graphical User Interface (GUI) programming using Windows Forms, Menus and Graphics Objects is covered. Sample applications such as Simple Interest and Matrix Grid will help you to familiarize with common frequently used Namespaces. Usage of  various Packages such as java.awt,  javax.swing  etc are illustrated in this tutorial. A brief explanation of all important  Packages and classes are given belowl.

Java.awt- The java.awt package contains all of the classes for creating user interfaces and for painting graphics and images. A user interface object such as a button or a scrollbar is called, in AWT terminology, a component. The Component class is the root of all AWT components. The AWTEvent class and its subclasses are used to represent the events that AWT components can fire.

Some of the classes in the java.awt package are:

The root event class for all AWT events.
The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary color spaces identified by a ColorSpace.
A component is an object having a graphical representation that can be displayed on the screen and that can interact with the user.
A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT components.
The Font class represents fonts, which are used to render text in a visible way.
The Graphics class is the abstract base class for all graphics contexts that allow an application to draw onto components that are realized on various devices, as well as onto off-screen images.
The abstract class Image is the superclass of all classes that represent graphical images.

Javax.swing- The javax.swing provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
Some of the classes in javax.swing namespace are:

A lightweight container that uses a BoxLayout object as its layout manager.
An extended version of java.applet.Applet that adds support for the JFC/Swing component architecture.
A lightweight object that provides many of the features of a native frame, including dragging, closing, becoming an icon, resizing, title display, and support for a menu bar.
JPanel is a generic lightweight container.
LayoutStyle provides information about how to position components.
Popups are used to display a Component to the user, typically on top of all the other Components in a particular containment hierarchy.
This class manages repaint requests, allowing the number of repaints to be minimized, for example by collapsing multiple requests into a single repaint for members of a component tree.
A collection of utility methods for Swing.
Fires one or more ActionEvents at specified intervals.
UIManager manages the current look and feel, the set of available look and feels, PropertyChangeListeners that are notified when the look and feel changes, look and feel defaults, and convenience methods for obtaining various default values.

Video Tutorial Links

Watch the youtube video of Matrix Grid Example

Watch Youtube Video of Simple Interest Example


Download Java In Easy Steps Video Tutorials