tags:

views:

215

answers:

3

What is Widget in java?

+1  A: 

A widget in any GUI toolkit (at least all of the ones I know of) are the controls that you use to make up a GUI, such as Buttons, Spinners, Panels, etc...

TofuBeer
+4  A: 

From "Widget nomenclature":

A "widget" is a generic term for a manufactured object. The word first occurs in the 1924 Broadway play Beggar on Horseback as an object with no real value, yet mass produced for common usage.

The term "widget" is also used to describe the basic building blocks of a desktop operating system's graphical user interface.

Through the first Applets, AWT contributed to its share of widget:
(From "AWT, Swing, SWT, and JFace: A comparison of Java GUI libraries")

The Abstract Window Toolkit (AWT) was Java's original attempt at creating Graphical User Interfaces (GUIs), included with the 1.0 release of Java in 1996.
The implementation of AWT uses a peer approach: each Java widget has a corresponding component in the underlying windowing system.
This allows for snappy widgets with native performance.
However, because not all windowing systems have the same selection of widgets, a "lowest common denominator" approach was taken in which only the widgets offered by all of the native windowing systems are available in AWT.

Since the rich GUI developed with Swing since 1998, "JavaWidget" does not reference "desktop widget" anymore, but simply all the GUI controls (which used to be based on the underlying "desktop" Os)

VonC