Sie sind auf Seite 1von 4

Swing Components I

Introduction to JFC and Swing


JFC is short for Java Foundation Classes, which encompass a
group of features for building graphical user interfaces (GUIs) and
adding rich graphics functionality and interactivity to Java applications.
The Swing API is only one of five libraries that make up the JFC.
The Java Foundation Classes also consist of the Abstract Window Toolkit
(AWT), the Accessibility API, the 2D API, and enhanced support for
drag-and-drop capabilities.

AWT
The Abstract Window Toolkit is the basic GUI toolkit shipped with
all versions of the Java Development Kit. While Swing does not reuse
any of the older AWT components, it does build off of the lightweight
component facilities introduced in AWT 1.1.
Accessibility
The accessibility package provides assistance to users who
have trouble with traditional user interfaces. Accessibility tools can be
used in conjunction with devices such as audible text readers or braille
keyboards to allow direct access to the Swing components. Accessibility
is split into two parts: the Accessibility API, which is shipped with the
Swing distribution, and the Accessibility Utilities API, distributed
separately. All Swing components contain support for accessibility
2D API
The 2D API contains classes for implementing various
painting styles, complex shapes, fonts, and colors. This Java package is
Bhanudas Satam 9869281034

BSc.[Computer Science]

Page 1

loosely based on APIs that were licensed from IBM's Taligent division.
The 2D API classes are not part of Swing
Drag and Drop
Drag and drop is one of the more common metaphors used
in graphical interfaces today. The user is allowed to click and "hold" a
GUI object, moving it to another window or frame in the desktop with
predictable results. The Drag and Drop API allows users to implement
droppable elements that transfer information between Java applications
and native applications. Drag and Drop is also not part of Swing.

Features of the Java Foundation Classes


Explain the features of JFC?
1. Swing GUI Components: Includes everything from buttons to
split panes to tables. Many components are capable of sorting,
printing, and drag and drop, to name a few of the supported
features.
2. Pluggable Look-and-Feel Support: The look and feel of Swing
applications is pluggable, allowing a choice of look and feel. For
example, the same program can use either the Java or the
Windows look and feel. Additionally, the Java platform supports
the GTK+ look and feel, which makes hundreds of existing look
and feels available to Swing programs. Many more look-and-feel
packages are available from various sources.

3. Accessibility API: Enables assistive technologies, such as screen


readers and Braille displays, to get information from the user
interface.
4. Java 2D API: Enables developers to easily incorporate highquality 2D graphics, text, and images in applications and applets.
Java 2D includes extensive APIs for generating and sending highquality output to printing devices.
5. Internationalization: Allows developers to build applications
that can interact with users worldwide in their own languages and
cultural conventions. With the input method framework
developers can build applications that accept text in languages
that use thousands of different characters, such as Japanese,
Chinese, or Korean.
Bhanudas Satam 9869281034

BSc.[Computer Science]

Page 2

Swing API Component

Explain the top-level containers of swing?


Swing provides four generally useful top-level container classes:
1.
2.
3.
4.

JFrame
JDialog
JApplet
JWindow

(See the practical sheet for details)


Each program that uses Swing components has at least one top-level
container. This top-level container is the root of a containment
hierarchy the hierarchy that contains all of the Swing components
that appear inside the top-level container.

Bhanudas Satam 9869281034

BSc.[Computer Science]

Page 3

JComponent Class

Components
Windows, Dialog Boxes, and Panels,
Labels
Buttons
Check Boxes
Menus
Pane
JScrollPane
Desktop pane
Scrollbars
Lists and Combo Boxes
Text-Entry Components

The base class for all Swing components except top-level containers.

Bhanudas Satam 9869281034

BSc.[Computer Science]

Page 4

Das könnte Ihnen auch gefallen