Java : GUI Apps - Part 1 (11)

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

by default, the input dialog box has the string _____ in its title bar & displays a _____ icon

"Input" question (747)

Programmers are limited to what they can do with AWT because _____

*AWT* does not actually draw user interface components on the screen (741)

within the JFC you use the _____ or _____ classes to create a *graphical user interface*

*Abstract Windowing Toolkit [AWT]* or *Swing* classes (739)

what does *AWT* stand for?

*Abstract Windowing Toolkit [AWT]* (740)

the _____ class allows you to quickly *display a dialog box*, which is a small graphical window *displaying a message or requesting input*

*JOptionPane* class (742)

constants used for the message dialog box include:

*JOptionPane._____ _MESSAGE* -ERROR_MESSAGE -INFORMATION_MESSAGE -WARNING_MESSAGE -QUESTION_MESSAGE -PLAIN_MESSAGE (744)

confirm dialog box constants:

*JOptionPane._____ _OPTION* -YES_OPTION -NO_OPTION -CANCEL_OPTION (749)

Java programmers use the _____ to create GUI apps

*Java Foundation Classes [JFC] (740) ~consists of several sets of classes

in Java, you use the _____ to create a *graphical user interface* for your app

*Java Foundation Classes [JFC]* (739)

AWT allows programmers to create _____ & _____ that interact with the user via windows & other GUI components

*apps* & *applets* (740)

a window in a GUI commonly consists of several _____ that present data to the user and/or allow interaction with the app

*components* (739)

a(n) _____ is a small graphical window that displays a message to the user or requests input

*dialog box* (742)

a(n) _____ is an object that automatically executes 1 or its methods when a specific event occurs ~does something

*event listener* (742)

the component that generates the event object is the _____

*event source* (763)

a(n) _____ is an *action* that takes place within a program, such as clicking of a button

*event* (763) ~when an event occurs, the component responsible for the event creates an event object in memory

programs that operate in a GUI environment must be _____

*event-driven* (742)

What does *GUI* stand for?

*graphical user interface* (739)

header for the actionPerformed method [code]

*void actionPerformed(ActionEvent e)* (765) ~e is the object

by default, the *message dialog box* has the string ____ displayed in its title bar, & a(n) _____ icon is displayed

-"Message" -information "i" (744)

NOTE

-*AWT components* are commonly called *heavyweight components* because they are coupled with their unerlying peers -very few of the *Swing components* are coupled with peers, so they are called *lightweight components* (741)

*Input Dialog* [JOptionPane]

-*dialog box* that prompts the user for *input* -it provides a *text field* where input is typed -an OK button & a Cancel button are displayed (742)

pixel

-1 of the small dots that make up a screen display -the resolution of your monitor is measure this way (754)

radio button [component]

-a component that can be either *selected* or *deselected* -usually appear in groups & allow the user to select 1 or several options (740)

combo box [component]

-a component that displays a drop-down list of items from which the user may select -provides a text field in which the user may type input -the combination of a list & a text field (740)

common *GUI components* include:

-buttons -labels -text fields -check boxes -radio buttons (739)

Confirm Dialog [JOptionPane]

-dialog box that asks the user a Yes/No question -a Yes button, a No button, and a Cancel button are displayed (742)

Message Dialog [JOptionPane]

-dialog box that displays a message -an OK button is also displayed (742) ~*showMessageDialog method*

when you write an action listener class, it must meet the following requirements:

-it must *implement* the *ActionListener* interface -it must have a *method named actionPerformed* this method must take an argument of the ActionEvent type (usually being e) (763)

FACT

-the event object contains information about the event. (763)

GUI Applications - Part 1 (11) (739-831)

GUI Applications - Part 1 (11) (739-831)

FACT

JButton components generate action events so we must write an action listener class (763)

_____ is a library of classes that do not replace the *AWT*, but provide an improved alternative for creating *GUI apps* & *applets*

Swing (741) ~part of the *javx.swing* package

you can use _____ classes to create windows containing various GUI components

Swing classes (753)

FACT

a GUI program does not stop executing when the end of the main method is reached (752)

*button* [component]

a button that can use an action to occur when it is *clicked* (740)

FACT

a common technique for writing an event listener class is to write it as a private inner class inside the class that creates the GUI (764)

slider [component]

a component that allows the user to select a value by moving a slider along a track (740)

check box [component]

a component that has a box that may be checked or unchecked (740)

what is a *GUI*?

a graphical window or a system of graphical windows presented by an app for interaction with a user (739) ~accepts keyboard & mouse input

list [component]

a list from which the user may select an item (740)

thread

a task running in the JVM (752)

when a JButton component generates an event, it automatically executes the _____ method of the action listener object it is connected to, passing the event object as an argument

actionPerformed method (764)

*text field* [component]

an area in which the user may type a single *line of input* from the keyboard (740)

*label* [component]

an area that can display text (740)

peer classes

another layer of software (741)

a(n) _____is simply a component that holds other components

container (753)

a(n) _____ is a container that is part of every JFrame object

content pane (759) ~cannot be seen and has no border

after the event listener, the method then performs any actions that it was programmed to perform in response to the event. this process is sometimes referred to as _____

event firing (763)

a(n) _____ is an object that responds to events.

event listener (763)

in GUI terminology, a container that can be displayed as a window is known as a(n) _____

frame (753)

a(n) ______ suspends execution of any other statements until the dialog box is closed

modal dialog box (746)

a(n) _____ is a container that holds GUI components

panel (759)

process of connecting an event listener object to a component is _____

registering the event listener (765)

the *JOptionPane* class, which is in the *javax.swing* package, provides _____ methods to display each type of dialog box

static (742)

FACT

the *AWT classes* are part of the *java.awt* package [note that there is *no x after java in the package* name] (741)

FACT

the ActionListener interface is in the java.awt.event package, so you must have an import statement for that package in your source code (764)

decorations

the minimize, maximize, and close button (754)

FACT

when the user clicks a button, the JButton component generates an event object; the JButton component that generated the event object is the event source (763)


संबंधित स्टडी सेट्स

Bones, Location, Articulation, and Markings

View Set

Chapter 61: Caring for Clients Requiring Orthopedic Treatment

View Set

Chapter 10 Standard Costs and Variances

View Set

Python for CP1-2 (Part 1:Beginning)

View Set