Java Programming With GUI Report
Java Programming With GUI Report
with GUI
Prepared by:
Efril Datulaita
Sunshine Agos
Angelic Nillo
Java Programming
with GUI
What is GUI
Basic GUI objects
Abstract Window Toolkit
Swing
Swing Components
WHAT IS GUI ?
Pronounced as (goo-ee)
GUI stands for Graphical User
Interface
Displays a graphical images(text
boxes, buttons, and icons) on the
screen that the user can interact or
manipulate with devices such as
mouse.
WHAT IS GUI ?
A GUI obtains information from the
user and gives it to the program for
processing. When the program is
finished processing information, the
GUI gives the result to the user,
usually in some sort of window.
A GUI is built by putting
components into containers.
WINDO
W
MEN
U
BUTTON
LABE
L
TEXT
BOX
LABEL
Button
A button that is simply something that
ABSTRACT WINDOW
TOOLKIT
Abstract Window Toolkit (AWT) is a
collection of graphical user interface
(GUI) components (widgets) and
other related services required for
GUI programming in Java.
AWT was platform dependent, which
means a program written in AWT
behaves differently in different
platforms.
ABSTRACT WINDOW
TOOLKIT
AWT components require the
resources of the operating system
on which they are installed
They are called heavyweight
components.
ABSTRACT WINDOW
TOOLKIT
Checkbox
Item that can be in either an on(true) or
off(false) state.
Checkbox box = new Checkbox();
Label
Used to show the text or string in an application
and label never perform any type of action.
Label lab1 = new Label():
ABSTRACT WINDOW
TOOLKIT
List
Presents the user with a scrolling list of text items.
Listlists=newList(5);
Scrollbar
Provides a convenient means for allowing a user to
select from a range of values.
Scrollbar sb = new Scrollbar();
TextArea
A text container component, contains plain text.
TextArea inputArea = new TextArea();
TextField
A text container component, contains single line and
limited text information.
TextField nf = new TextField();
SWING
A swing application developed on
one platform behaves the same on
any other platform in which Java is
installed. Extends capabilities in
Abstract Window Toolkit (AWT)
Swing gives far more options for
everything (buttons with pictures on
them, etc.)
SWING COMPONENTS
Swing components are platform
independent, requiring only the Java
runtime system to function.
They are called lightweight
components.
Names of the Swing GUI
components are almost similar to
that of AWT
SWING COMPONENTS
JCheckBox
cb=new JCheckBox();
JLabel
JLabel jlb = new JLabel();
SWING COMPONENTS
Jlist
JList dataList = new JList(data);
JScrollbar
JScrollPane scrollPane = new JScrollPane();
JTextArea
JTextArea resultArea = new JTextArea();
JTextField
JTextField txt = new JTextField();