PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

Share a file Manage my documents Convert Recover PDF Search Help Contact



JavaUnit4.pdf


Preview of PDF document javaunit4.pdf

Page 12319

Text preview


Java/J2EE

UNIT-4: SWINGS

06CS753

Swing is built on top of AWT and is entirely written in Java, using AWT’s lightweight
component support. In particular, unlike AWT, t he architecture of Swing components
makes it easy to customize both their appearance and behavior. Components from AWT
and Swing can be mixed, allowing you to add Swing support to existing AWT-based
programs. For example, swing components such as JSlider, JButton and JCheckbox could
be used in the same program with standard AWT labels, textfields and scrollbars.
1. Three parts
Component set (subclasses of JComponent) Support classes, Interfaces
Swing Components and Containers
Swing components are basic building blocks of an application. Swing toolkit has a
wide range of various widgets. Buttons, check boxes,sliders, list boxes etc. Everything
a programmer needs for his job. In this section of the tutorial, we will describe several
useful components.
JLabel Component
JLabel is a simple component for displaying text, images or both. It does not react to
input events.
JCheckBox
JCheckBox is a widget that has two states. On and Off. It is a box with a label JSlider
JSlider is a component that lets the user graphically select a value by sliding a knob
within a bounded interval
JComboBox
Combobox is a component that combines a button or editable field and a drop-down
list. The user can select a value from the drop-down list, which appears at the user's
request.
JProgressBar
A progress bar is a widget that is used, when we process lengthy tasks. It is animated
so that the user knows, that our task is progressing
JToggleButton

48

Page