AWT - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

AWT Graphics

AWT Graphics

shape Introduction

AWT Graphics gives an idea about
  • CUI and GUI
  • Advantages of GUI
As discussed in the previous chapter, a user can interact with a Java program in two ways-using commands and mouse clicks. These ways can be officially termed as The below figure clearly shows the difference.

shape Conceptual figure

CUI

shape Description

Command User Interface lets the user to interact with a Java program using commands in the command prompt. It is time taking process and needs much effort while communicating.

GUI

shape Description

Graphical User Interface lets the user to interact with a Java program using the graphic window. GUI can be built by including java.awt package, which provides pre-defined classes to GUI.

GUI Vs. CUI

shape Advantages

  • A user can easily operate GUI applications as they are user friendly compared to CUI.
  • GUI enables the user to perform multiple operations at a time, whereas, this is not possible in CUI.
  • High speed is one of the main advantages of GUI control.
  • An application can be operated in just a click using GUI, whereas, in CUI, a number of commands have to be inputted to complete the action.

shape Conceptual figure

Container Class

shape Description

The classes that are pre-defined in java.awt package and used to perform output actions are called as Container classes. These classes helps in displaying output to the end-user with the help of frame and panel.

Non-Container Class

shape Description

The classes that are pre-defined in java.awt package and used to perform input actions are called as Non-Container classes. These classes helps the end-user to communicate with the Java application with the help of labels, and buttons.

shape Examples

The following are a few real-time applications that use GUI interface:
  • Mobile Applications
  • Banking Applications
  • Air Ticket System
  • ATM

Summary

shape Key Points

  • GUI is Graphical User Interface.
  • It imports java.awt package.
  • GUI applications are mostly used in real-time.
  • Container class and Non-container class are the types of classes.