Home
Explore
Exams
Search for anything
Login
Get started
Home
Engineering
Computer Science
Week 9
0.0
(0)
Rate it
Studied by 0 people
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Card Sorting
1/54
Earn XP
Description and Tags
Computer Science
University/Undergrad
Add tags
Study Analytics
All
Learn
Practice Test
Matching
Spaced Repetition
Name
Mastery
Learn
Test
Matching
Spaced
No study sessions yet.
55 Terms
View all (55)
Star these 55
1
New cards
MouseEvent Class
An event that indicates that a mouse action occurred in a component such as pressing a mouse button.
2
New cards
MouseEvent
When the user presses one of the buttons on a mouse, an object that belongs to a ____________ class is constructed
3
New cards
Event Source
component to which the user clicked
4
New cards
x and y coordinates
the point in the component where the click occurred
5
New cards
mouse-based
To work, the mouse event type should be registered by adding the appropriate __________ Event Listener to the component.
6
New cards
MouseListener
used for basic mouse-oriented events
7
New cards
MouseListener
happens when the mouse is clicked or released
8
New cards
MouseMotionListener
used for the motion-oriented events
9
New cards
MouseMotionListener
happens whenever the mouse is moved; frequent
10
New cards
public void mousePressed(MouseEvent evt)
method called when the user presses down a mouse button
11
New cards
public void mouseReleased(MouseEvent evt)
method called when the user releases a button
12
New cards
public void mouseClicked(MouseEvent evt)
method called if the user presses a mouse button and then releases it, without moving the mouse.
13
New cards
public void mouseClicked(MouseEvent evt)
The mousePressed, mouseReleased, and mouseClicked routines are all called in that order.
14
New cards
mousePressed
In most cases, you should define _______ instead of mouseClicked
15
New cards
public void mouseEntered(MouseEvent evt)
method called when the mouse cursor enters the component.
16
New cards
public void mouseExited(MouseEvent evt)
method called when the mouse cursor leaves the component.
17
New cards
object
Registering Mouse Events:
create an ______ that implements the MouseListener interface
18
New cards
addMouseListener()
Registering Mouse Events:
register the object to listen for events by calling a component's ____________ method.
19
New cards
public void mouseDragged(MouseEvent evt)
method called when the user moves the mouse while holding down a mouse button until the button is released
20
New cards
F
public void mouseDragged(MouseEvent evt) only works if the mouse position is within the bounds of the component
T or F
21
New cards
public void mouseMoved(MouseEvent evt)
method called when the user moves the mouse while no mouse button is down
22
New cards
MouseEvent
The _______ object in the parameter contains the x and y coordinates of the mouse's location
23
New cards
MouseMotionListener
Registering MouseMotion Events:
create an object that implements the _____________ interface
24
New cards
addMouseMotionListener()
register the object to listen for events by calling a component's
_____________________ method
25
New cards
MouseListener
In most cases, the listener object will also implement the ___________ interface so that it can respond to the other mouse events as well
26
New cards
Menu
is a list of buttons each of which have their own corresponding action when selected
27
New cards
Drop-Down
Types of Menu:
usually associated with an application's menubar
28
New cards
Pop-Up
Types of Menu:
associated with any container component (i.e., often accessed via right button click)
29
New cards
Cascaded
Types of Menu:
pops up when another menu item is selected (i.e. a sub menu)
30
New cards
pull-down
Types of Menu:
other term for drop-down menu
31
New cards
JMenuBar
An object at the top of the frame that contains "pull down" menus. There can be only one per frame.
32
New cards
names
Only the _____ of the pull down menus are displayed on the menubar.
33
New cards
JMenu
A menu that may contain menu items, separator lines, and other menus.
34
New cards
JMenuItems
menu items which the user can select from (like buttons)
35
New cards
JSeparators
separator lines to divide up the items into logical groupings
36
New cards
action
The user selects an option and an _____ is performed
37
New cards
JMenu
It is added to a JMenuBar object by specifying its name (or label) which will appear on the menubar
38
New cards
JMenuItem
A button on a menu. When the user selects the "button", the action associated with the menu item is performed
39
New cards
ImageIcons
__________ can be used on menus as well by assigning an icon to a menultem (just like JButtons)
40
New cards
JRadioButtonMenuItem
A menu item that is part of a group of menu items in which only one item in the group can be selected
41
New cards
JPopupMenu
A small window which pops up and displays a menu of choices
42
New cards
JPopupMenu
Used for the menu that appears when the user selects an item on the menu bar (similar to cascaded menu)
43
New cards
JPopupMenu
Also used for "pull-right" menus that appear when the user selects a menu item that activates it
44
New cards
JPopupMenu
can also be used anywhere else you want a menu to appear (e.g., when the user right-clicks in a specified area)
45
New cards
JFrame
A single JMenuBar is added to a __________
46
New cards
JMenus
Multiple ______ are added to the JMenuBar
47
New cards
JFrame
JPopupMenus are added to _______
48
New cards
setJMenuBar()
method used to set the JFrame's menubar to the instance of JMenuBar
49
New cards
.setMnemonic();
method used to set the keyboard accelerators (i.e., quick keys)
50
New cards
dialog box
a separate window that pops up in response to an event occurring in a
window
51
New cards
dialog box
often used to obtain information from the user
52
New cards
Message Dialog
displays a message indicating information, errors, warnings etc
53
New cards
Confirmation Dialog
asks a question such as yes/no
54
New cards
Input Dialog
asks for some kind of input
55
New cards
Option Dialog
asks the user to select some option