CS102: Human-Computer Interfaces (HCI)

Copyright © 1999, Kenneth J. Goldman


In computer science, all communication between different entities is described in terms of "interfaces" (in the generic sense, not the JAVA sense).

So far, we've seen interfaces between ...

the programmer and the computer programming languages
the computer and peripheral devices hardware interfaces, cables
objects their methods
a method caller and the method parameter lists
packages and their users API's
programmers and other programmers external documentations
the software application and the human user Human-Computer Interface (HCI)

But there is one interface that stands out from the rest, because it is the most visible, and in many respects the most important. It is the interface between the software application and the human user.

This interface is known as the Human-Computer Interface (HCI), and it continues to be a very important research area, partly because when it comes to the interaction between humans and computers, we still have a very long way to go.

History of HCI

Some HCI history:

Goal of HCI

The goal in any HCI design is to provide the best possible interaction with the technology currently available.

Important HCI design principles and advices

Some important HCI design principles (from a classic paper by Ben Schneiderman, "Direct Manipulation: A Step Beyond Programming Languages", IEEE Computer August 1983) that apply to graphical user interface design:

Some other common advices:

JAVA support for user interface construction

JAVA's package java.awt is an Abstract Window Toolkit (AWT), meaning that it provides an abstraction of a graphics window system that runs on top of whatever operating system and hardware the JVM (JAVA Virtual Machine) is implemented for.

This is nice because:

In addition, the SWING library allows graphics applications to take on the "look and feel" based on where they are running.

Let's take a look at what the AWT provides ...

The AWT provides support for user interfaces in which

So, you build a user interface from instances of these subclasses or subclasses you define.

For arranging them nicely on the screen, the AWT provides several layout managers that arrange the screen space in different ways, taking into account the preferred sizes of the components:

For example:
Frame f = new Frame();
f.setLayout(new BorderLayout());
Button quit = new Button("quit");
Label name = new Label("My Drawing");
Canvas display = new MyCanvas();
//a subclass of canvas override paint
f.add(quit, BorderLayout.EAST);
f.add(display, BorderLayout.CENTER);
f.add(name, BorderLayout.SOUTH);
// tells layout manager to do its thing and set the size of the frame based on the components
// makes the frame visible

A complex application will do a combination of its own drawing and use the provided components and layout for other things. If you want more control over how components are arranged, you can define your own LayoutManager.