|
 
 

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:


AWTEvent

The root event class for all AWT events.

Color

The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary color spaces identified by a ColorSpace.

Component

A component is an object having a graphical representation that can be displayed on the screen and that can interact with the user.

Container

A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT components.

Font

The Font class represents fonts, which are used to render text in a visible way.

Graphics

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.

Image

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:


      Box

A lightweight container that uses a BoxLayout object as its layout manager.

JApplet

An extended version of java.applet.Applet that adds support for the JFC/Swing component architecture.

JInternalFrame

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

JPanel is a generic lightweight container.

LayoutStyle

LayoutStyle provides information about how to position components.

Popup

Popups are used to display a Component to the user, typically on top of all the other Components in a particular containment hierarchy.

RepaintManager

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.

SwingUtilities

A collection of utility methods for Swing.

Timer

Fires one or more ActionEvents at specified intervals.

UIManager

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