[go: up one dir, main page]

0% found this document useful (0 votes)
7 views27 pages

Java Revision Tour-II

Uploaded by

rayin58259
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views27 pages

Java Revision Tour-II

Uploaded by

rayin58259
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Java GUI Programming (R-II)

XII-IP
Introduction
• To create Java GUI applications swing API is
important, with the help of Swing API RAD is
implemented in Net Beans.
• Swing controls (components) categorized into two
categories :
• Container(parent control)- special type of
component that can hold other components.
• Component(child control) – self-contained graphic
entity that can be customized and inserted into
applications.
Types of Swing Controls
• Basic Control – Jbutton, JCheckBox, JComboBox, Jlist, JRadioButton etc
• Interactive Display- Jtable, JTextArea, Jtree, JFileChooser etc
• Uneditable display – Jlabel, JProgressBar, JToolTip etc
• Top Level Container- Jframe, Jdialog, JApplet etc.
• General Purpose Container- Jpanel, JToolBar, JScrollPane etc
• Special Purpose Container – JInternalFrame, JLayeredPane, RootPane
etc.
Some useful controls
• Label
• Text field
• Push button
• Text area
• Check Box
• Radio Button
• List Box
• Combo Box
Properties and Methods
jLabel Control
A Label control displays text and that the user cannot
directly change or edit. It is uneditable control.
TextField Control
A textfield is an object of the class jTextField and is
displayed as a field that allows the user to enter
single line of text.
jButton Control
Push button is created by jButton class. It accept the request
from users by clicking. A button is a component that the user
presses or pushes to trigger a specific action. When the user
clicks on the button at runtime, the code associated with
the click action gets executed.
jTextArea Control
This component allows us to accept multiline input from the
user or display multiple lines of information. This component
automatically adds vertical or horizontal scroll bars as and
when required during run time.
jPassword Control
A Password field is a type of text field that shows encrypted
text.
jCheckBox Control
jCheckBox is a small box like component that is either marked
or unmarked. When you click on it, it changes from checked to
unchecked or vice versa automatically.
jRadioButton Control
A Radio Button present a set of two or more choices to the users. The
button group allows only one of its components to be selected. Button
group is created through JButtonGroup API class. An item event is handled
through item listener whose interface has method itemStateChanged()
that handle item event.
jList Control
A List is a box-shaped control containing a list of values from
which single or multiple selections can be made.
jComboBox Control
jComboBox is like a drop down box - you can click a drop-down
arrow and select an option from a list whereas jList provides a
scrollable set of items from which one or more may be selected.

You might also like