Java Swing ( Java Foundation Classes ) Examples

Frame

The javax.swing.JFrame is an extended version of java.awt.Frame which comes under JFC (Java Foundation Classes). It has a method to close when user close frame.


Applet

The javax.swing.JApplet is an extended version of java.Applet which comes under JFC (Java Foundation Classes). It is wrotten in Java Programming language which can be run in any Java enabled browser or appletviewer tool of JDK.


Borders

Border is capable border around the swing components/controls. The setBorder() is used to set border to the components.You can share the same border in various components using javax.swing.BorderFactory.


DialogBox

The javax.swing.JDialog is an extended version of java.awt.Dialog. It is a container where you can add controls.It is used to take information from the user.


Events

The Event handling describes how can you trap the different kind of events in Java GUI program. The java.awt.event package provide the classes ,interfaces and adapter classes to handle events in Java. The java.awt.AWTEvent class is root event class for all AWT events. Events are fired by event sources.An event listener registers an event source to trap the events of event type.


LayoutManager

The layout managers are used to position the components. It implements the java.awt.LayoutManager interface.Java has various predefined classes of layout managers. All layout managers make use of the setLayout() method to set the layout of a container.If the setLayout() method is not used, then the default layout of the container is set.


Menu

A menu provides a space-saving way to let the user choose one of several options. Other components with which the user can make a one-of-many choice.


MessageBoxes

It makes easy to pop up a standard dialog box that prompts users for a value or informs them of something.


Table

The javax.swing.JTable is used to display and edit regular two-dimensional tables of cells.It has many facilities that make it possible to customize its rendering and editing but provides defaults for these features so that simple tables can be set up easily.


Tabpane

A component that facilitate to the user to switch between a group of containers/components by clicking on a tab with a given title.


Toolbar

javax.swing.JToolBar provides a component that is useful for displaying commonly used Actions or controls. Toolbar can drag and drop into a seperate window.


Tree

A control that contains the hierarchical data in the form of controls. It is like Windows Explorer.