Advances Java 1
Advances Java 1
Interface (GUI)
Topic 1
• When a lot of us hear the word "gooey," we think about sticky buns or
creamy sugary fillings (yum). Others think "GUI", as in "Graphical User
Interface." A GUI is what computer types call the system of icons,
taskbars, and other objects that our computers use to display and
access information. A few of us may wonder how the GUI came to
be. We remember the halcyon days of DOS prompts and command
line interactions; some of us then take an aspirin and lie down. Others
continue to wonder how exactly we got from esoteric UNIX, CP/M,
and DOS commands on green screens to playing with pretty pictures
and colorful desktops.
Graphical User Interface
Graphical
Relating to visual art or computer graphics.
User
A person who uses or operates something,
especially a computer or other machine.
Interface
A point where two systems, subjects,
organizations, etc. meet and interact.
What is Graphical User Interface or GUI?
• Graphical User Interface (GUI) is a visual way
of interacting with the computer using the
components like windows, icons, labels, text-
boxes, radio buttons, etc.
• GUI is a program interface that takes the
advantage of the computer graphics
capabilities to make the program easier to
use.
• A well designed GUI helps the users to get rid
from remembering complex commands by
presenting command driven graphical layout.
What is Graphical User Interface or GUI?
• GUI uses windows, icons and menus to carry out
commands such as opening files, deleting files and
moving files.
• It refers to the graphical interface of a computer that
allows users to click and drag objects with a mouse
instead of entering text at a command line.
• In Java, GUI-based programs are implemented by
using classes from the javax.swing and java.awt
packages. žThe Swing classes provide greater
compatibility across different operating systems. They
are fully implemented in Java, and behave the same on
different operating systems.
2 types of GUI
• 1. Component: are elementary GUI entities, such as
Button, Label, and TextField.
• 2. Container: such as Frame and Panel, are used to
hold components in a specific layout (such as
FlowLayout or GridLayout). A container can also hold
sub-containers.
Graphical User Interface
• In the above figure, there are three containers: a Frame and two Panels. A Frame
is the top-level container of an AWT program. A Frame has a title bar (containing
an icon, a title, and the minimize/maximize/close buttons), an optional menu bar
and the content display area. A Panel is a rectangular area used to group related
GUI components in a certain layout. In the above figure, the top-level Frame
contains two Panels. There are five components: a Label (providing description),
a TextField (for users to enter text), and three Buttons (for user to trigger certain
programmed actions).
Graphical User Interface