Awt 简明教程

AWT - Overview

Graphical User Interface

图形用户界面 (GUI) 通过一些图形组件提供用户交互。例如,我们底层的操作系统还通过窗口、框架、面板、按钮、文本字段、文本区域、列表框、组合框、标签、复选框等提供 GUI。这些都称为组件。使用这些组件,我们可以为应用程序创建一个交互式用户界面。

Graphical User Interface (GUI) offers user interaction via some graphical components. For example our underlying Operating System also offers GUI via window,frame,Panel, Button, Textfield, TextArea, Listbox, Combobox, Label, Checkbox etc. These all are known as components. Using these components we can create an interactive user interface for an application.

GUI 根据激发的事件向最终用户提供结果。GUI 完全基于事件。例如,单击按钮、关闭窗口、打开窗口、在文本区域中键入内容等。这些活动称为事件。GUI 使最终用户可以更容易使用一个应用程序。它还使它们更有趣。

GUI provides result to end user in response to raised events.GUI is entirely based events. For example clicking over a button, closing a window, opening a window, typing something in a textarea etc. These activities are known as events.GUI makes it easier for the end user to use an application. It also makes them interesting.

Basic Terminologies

Term

Description

Component

Component is an object having a graphical representation that can be displayed on the screen and that can interact with the user. For examples buttons, checkboxes, list and scrollbars of a graphical user interface.

Container

Container object is a component that can contain other components.Components added to a container are tracked in a list. The order of the list will define the components' front-to-back stacking order within the container. If no index is specified when adding a component to a container, it will be added to the end of the list.

Panel

Panel provides space in which an application can attach any other components, including other panels.

Window

Window is a rectangular area which is displayed on the screen. In different window we can execute different program and display different data. Window provide us with multitasking environment. A window must have either a frame, dialog, or another window defined as its owner when it’s constructed.

Frame

A Frame is a top-level window with a title and a border. The size of the frame includes any area designated for the border. Frame encapsulates window. It and has a title bar, menu bar, borders, and resizing corners.

Canvas

Canvas component represents a blank rectangular area of the screen onto which the application can draw. Application can also trap input events from the use from that blank area of Canvas component.

Examples of GUI based Applications

以下是基于 GUI 的应用程序的一些示例。

Following are some of the examples for GUI based applications.

  1. Automated Teller Machine (ATM)

  2. Airline Ticketing System

  3. Information Kiosks at railway stations

  4. Mobile Applications

  5. Navigation Systems

Advantages of GUI over CUI

  1. GUI provides graphical icons to interact while the CUI (Character User Interface) offers the simple text-based interfaces.

  2. GUI makes the application more entertaining and interesting on the other hand CUI does not.

  3. GUI offers click and execute environment while in CUI every time we have to enter the command for a task.

  4. New user can easily interact with graphical user interface by the visual indicators but it is difficult in Character user interface.

  5. GUI offers a lot of controls of file system and the operating system while in CUI you have to use commands which is difficult to remember.

  6. Windows concept in GUI allow the user to view, manipulate and control the multiple applications at once while in CUI user can control one task at a time.

  7. GUI provides multitasking environment so as the CUI also does but CUI does not provide same ease as the GUI do.

  8. Using GUI it is easier to control and navigate the operating system which becomes very slow in command user interface. GUI can be easily customized.