0% found this document useful (0 votes)
53 views2 pages

HCI Practical WorkBook1

GUI programming involves graphical components like buttons and text fields that are organized into a graphical user interface. In Java, there are two sets of GUI components: the older Abstract Window Toolkit (AWT) components and the more modern Swing components, which allow applications to have a consistent look across platforms. Developing a GUI program in Java involves three main elements - graphical components that make up the visual interface, listener classes and methods that respond to user events by calling application methods, and application methods that perform the core functionality in response to these events.

Uploaded by

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

HCI Practical WorkBook1

GUI programming involves graphical components like buttons and text fields that are organized into a graphical user interface. In Java, there are two sets of GUI components: the older Abstract Window Toolkit (AWT) components and the more modern Swing components, which allow applications to have a consistent look across platforms. Developing a GUI program in Java involves three main elements - graphical components that make up the visual interface, listener classes and methods that respond to user events by calling application methods, and application methods that perform the core functionality in response to these events.

Uploaded by

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

INTRODUCTION TO GUI PROGRAMMING

GUI programming involves the use of a number of predefined components such as


buttons, checkboxes, text fields, windows, menus, etc that are part of the class
hierarchy. A GUI is a collection of instances of these components.
In Java, there are two sets of GUI components. Prior to Java version 1.2, Java
GUIs were build with components from the Abstract Windows Toolkit (AWT). The
AWT components are contained within the java.awt package. Java applications
using AWT display differently on each platform.
With Java 1.2, a more flexible Swing API was introduced. Swing GUI components
allow the designer to specify a uniform look and feel for a GUI application across
all platforms, or to use each platforms custom look and feel. Although we will
focus on Swing components, Swing and AWT are closely related, because Swing
relies on features of the AWT. The principles for using both components are
similar.
Using a Graphical User Interface, when you perform an action, an event is
generated. In event-driven programming, the program responds to the events.
The GUI programs that we will create in Java will contain three types of software.
These are:
1. Graphical components that make up the GUI are Swing objects. You
usually extend them to make them fit your application.
2. Listener classes/methods that receive the events and respond to them by
calling application methods, and
3. Application methods that do the work for the user. They are ordinary
Java methods that perform useful computations.
The graphical components are those like the ones listed above. You can use them
as they are, or extend them into your own classes. Listener methods are the
methods in your application that respond to different events. Listener methods
invoke application methods. An application method is a standard Java method to
perform useful tasks. They receive data from the GUI and send data to the GUI to
be displayed, but are not usually themselves concerned with the user interface.
In Java applications, generally these three types of software while keeping the big
picture in mind, should be kept separate (reduce coupling). Also note that in a big
software project an entire team of programmers is assigned to each of the tasks.

Why do we need GUI over CUI?


Before we get into the AWT, it is important to know the advantages of building GUI
applications over CUI apps.
1. GUI applications are user-friendly, they don't require user to have knowledge
of commands (like in the DOS).
2. GUI applications support multi tasking which means that the users can
perform various tasks (in other words, work with several apps) at a time.
For example, he can listen to music in foobar and play an NFS game. In a
CUI, you need a command to complete before executing another command.

3. In CUI you can only see text, where as in GUIs you can see images, videos
and flash.
Examples of GUI include Windows XP, Mac OS X, Ubuntu and those of CUI include
DOS etc.
.
.
.
Still in Progress
.
.
.

You might also like