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
Command User Interface
Graphical User Interface
The below figure clearly shows the difference.
Conceptual
figure
CUI
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
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
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.
Conceptual
figure
Container Class
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
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.
Examples
The following are a few real-time applications that use GUI interface:
Mobile Applications
Banking Applications
Air Ticket System
ATM
Summary
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.