Java AWT Unit 1 Quiz
32 Questions
15 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

The various controls supported by AWT are?

  • All of these (correct)
  • Checkboxes, choice, list
  • Labels, push buttons
  • Scroll bars, text area, text field

The concept of the menu bar can be implemented by using three Java classes—?

  • MenuBar
  • MenuItem
  • Menu
  • All of these (correct)

What is the constructor that the Text Event class defines?

TextEvent(Object source, int event_type)

In Java an event is an _______ which specifies the change of state in the source.

<p>Object</p> Signup and view all the answers

The classes and interfaces defined in AWT are contained within the ______ package.

<p>java.awt.*</p> Signup and view all the answers

What is the general form to set a specific type of layout manager?

<p>void setLayout(LayoutManager lm)</p> Signup and view all the answers

The AWT container is an instance of the ___________ class?

<p>Container (D)</p> Signup and view all the answers

A checkbox is a control that consists of?

<p>Both a &amp; b (D)</p> Signup and view all the answers

Java applets are used to create _______________ applications?

<p>Both a &amp; b (C)</p> Signup and view all the answers

AWT means?

<p>Abstract Window Toolkit (A)</p> Signup and view all the answers

An event is generated when the internal state of the event source is________?

<p>Changed (B)</p> Signup and view all the answers

Positions the components into five regions: east, west, north, south, center?

<p>BorderLayout (A)</p> Signup and view all the answers

Arranges the components as a deck of cards such that only one component is visible at a time?

<p>CardLayout (C)</p> Signup and view all the answers

Arranges the components horizontally?

<p>FlowLayout (B)</p> Signup and view all the answers

Arranges the components into a grid?

<p>GridLayout (D)</p> Signup and view all the answers

__________ creates a dropdown list of textual entries?

<p>Choice (D)</p> Signup and view all the answers

The Component class is an abstract class and so its ____________ are used to create components?

<p>Subclasses (D)</p> Signup and view all the answers

The AWT classes can be roughly categorized into the following groups?

<p>All of these (A)</p> Signup and view all the answers

An Applet is a ________ of Panel?

<p>Subclass</p> Signup and view all the answers

The subclasses of Window are?

<p>Both a &amp; b (B)</p> Signup and view all the answers

A menu bar represents?

<p>A list of menus which can be added to the top of a top-level window (D)</p> Signup and view all the answers

Each menu is associated with a _________ list of menu items?

<p>Drop-down (D)</p> Signup and view all the answers

The two types of menus which are given as follows?

<p>Both a &amp; b (B)</p> Signup and view all the answers

Regular menus are placed at the __________ of the application window within a menu bar?

<p>Top (A)</p> Signup and view all the answers

The text field and text area controls create a _________________ area respectively?

<p>Both a &amp; b (A)</p> Signup and view all the answers

A push button is an active control that has a _____________ appearance?

<p>Three dimensional (B)</p> Signup and view all the answers

_____________ is a superclass of TextField and TextArea classes that is used to create single-line or multiline textfields respectively?

<p>TextComponent (B)</p> Signup and view all the answers

A label is a simple control which is used to display_____________ on the window?

<p>Text(non-editable) (A)</p> Signup and view all the answers

______________ is an abstract class that encapsulates all of the attributes of a visual component?

<p>Component (C)</p> Signup and view all the answers

A _______ object is responsible for remembering the current foreground and background colors?

<p>Component (B)</p> Signup and view all the answers

Which class is a subclass of Component?

<p>Container (A), Frame (B), Window (C)</p> Signup and view all the answers

The ______ class is a concrete subclass of Container?

<p>Window</p> Signup and view all the answers

Flashcards

AWT

Abstract Window Toolkit; a Java API for creating graphical user interfaces (GUIs).

GUI Components

Elements like buttons, labels, text fields, and menus that make up a graphical user interface.

Container

A class that holds components and other containers in AWT.

Component

Abstract class in AWT, base class for visual interface elements.

Signup and view all the flashcards

Layout Manager

Organizes components within a container.

Signup and view all the flashcards

BorderLayout

Arranges components into north, south, east, west, and center.

Signup and view all the flashcards

CardLayout

Shows only one component at a time, arranges like cards.

Signup and view all the flashcards

FlowLayout

Arranges components horizontally.

Signup and view all the flashcards

GridLayout

Arranges components in a grid.

Signup and view all the flashcards

Push Button

Button that performs an action.

Signup and view all the flashcards

Label

Displays text.

Signup and view all the flashcards

Text Field

Single line text input.

Signup and view all the flashcards

Text Area

Multi-line text input.

Signup and view all the flashcards

Checkbox

A box for binary selection (on/off).

Signup and view all the flashcards

Menu

A list of options for commands.

Signup and view all the flashcards

MenuItem

Selectable option from a menu.

Signup and view all the flashcards

MenuBar

Parent menu which contains menus.

Signup and view all the flashcards

Applet

Small program for embedding in a web page.

Signup and view all the flashcards

Event

Change of state in an event source.

Signup and view all the flashcards

TextEvent

Java event related to text.

Signup and view all the flashcards

Choice

Dropdown list of text entries.

Signup and view all the flashcards

TextComponent

Superclass of TextField and TextArea

Signup and view all the flashcards

Study Notes

Abstract Windowing Toolkit (AWT)

  • AWT provides various controls, including labels, push buttons, checkboxes, choices, lists, scroll bars, text areas, and text fields.
  • Menu bars in AWT can be implemented using MenuBar, Menu, and MenuItem classes.
  • The TextEvent class constructor is defined as TextEvent(Object source, int event_type).
  • An event in Java is an object specifying the change of state in the source.
  • Classes and interfaces in AWT are located within the java.awt.* package.
  • The general form to set a specific type of layout manager is void setLayout(LayoutManager lm).
  • AWT containers are instances of the Container class, which holds various components and other containers.
  • A checkbox consists of a combination of a small box and a label, enabling binary selections.
  • Java applets are primarily used for creating graphical and user-interactive applications.
  • AWT stands for Abstract Window Toolkit.
  • An event is generated when the internal state of the event source is changed.
  • The BorderLayout positions components into five regions: east, west, north, south, and center.
  • CardLayout arranges components like a deck of cards, showing only one at a time.
  • FlowLayout arranges components horizontally.
  • GridLayout arranges components into a grid format.
  • The Choice control creates a dropdown list of textual entries.
  • The Component class is abstract, with subclasses being used to create actual components.
  • AWT classes are categorized into GUI Components, Layouts, Graphics Tools, and Event Handlers.
  • An Applet is a subclass of the Panel class.
  • Subclasses of Window include Dialog and Frame.
  • A menu bar displays a list of menus at the top of a top-level window.
  • Each menu is associated with a drop-down list of menu items.
  • Two types of menus in AWT are pop-up menus and regular menus.
  • Regular menus are positioned at the top of the application window within a menu bar.
  • Text field creates a single-line text area, while text area creates a multi-line text area.
  • A push button is an active control that typically has a three-dimensional appearance.
  • TextComponent is the superclass of TextField and TextArea classes, enabling single-line or multiline text inputs.
  • A label is used to display non-editable text on the window.
  • The Component class encapsulates attributes of visual components.
  • A Component object remembers the current foreground and background colors.
  • Container is a subclass of Component.
  • The Window class is a concrete subclass of Container.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

ajp_mcq_chapter_1.pdf

Description

Test your knowledge on Abstract Windowing Toolkit (AWT) in this Unit 1 quiz. This quiz covers various controls supported by AWT, menu bar implementation through Java classes, and the Text Event class constructor. Challenge yourself to score high and deepen your understanding of Java AWT.

More Like This

Java AWT and Event Driven Programming Quiz
10 questions
Mastering GUI Development in Java
10 questions
AWT in Java Quiz
5 questions

AWT in Java Quiz

VisionaryPeridot6562 avatar
VisionaryPeridot6562
Use Quizgecko on...
Browser
Browser