Exam 20: Graphical User Interfaces

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

a(n. ____ is used when you have a large set of choices.

(Multiple Choice)
4.8/5
(31)

Examine the code below.What type of class is MyMenuListener? public JMenuItem makeMenuItem(String menuLabel) { JMenuItem mini = new JMenuItem(menuLabel); class MyMenuListener implements ActionListener { public void actionPerformed(ActionEvent e) { doSomething(); } } mini.addActionListener(new MyMenuListener()); return mi; }

(Multiple Choice)
4.7/5
(40)

What is known for certain from this correct code excerpt? ActionListener openListener = new FileOpenListener(); JMenuItem fileOpen = new JMenuItem("Open File"); fileOpen.addActionListener(openListener);

(Multiple Choice)
4.8/5
(35)

If the method makeMenuItem is called four times, how many MyMenuListener objects will be created? public JMenuItem makeMenuItem(String menuLabel) { JMenuItem mi = new JMenuItem(menuLabel); class MyMenuListener implements ActionListener { public void actionPerformed(ActionEvent e) { doSomething(); } } mi.addActionListener(new MyMenuListener()); return mi; }

(Multiple Choice)
4.8/5
(38)

You can add a(n) _________ to a panel to make it visible.

(Multiple Choice)
4.8/5
(33)

When a menu item is selected, what type of event does it send?

(Multiple Choice)
4.8/5
(35)

Which method can a program use to set the selected choice in a JComboBox?

(Multiple Choice)
4.9/5
(40)

The JFrame has a content pane with a default BorderLayout manager.Which method allows changing it to a FlowLayout manager?

(Multiple Choice)
4.8/5
(36)

The statement that would add smallButton to the button group in the following code is _________. JRadioButton smallButton = new JRadioButton("Small"); ButtonGroup group = new ButtonGroup();

(Multiple Choice)
4.8/5
(36)

When using a combo box, the _______ displays the name of the current selection.

(Multiple Choice)
4.8/5
(40)

Which GUI element allows text entry from the program user?

(Multiple Choice)
4.8/5
(40)

Consider the scope of the three objects menuLabel, mi, and the anonymous object new MyMenuListener() within the JmenuItem class.How do thier lifetimes compare? public JMenuItem makeMenuItem(final String menuLabel) { JMenuItem mi = new JMenuItem(menuLabel); class MyMenuListener implements ActionListener { public void actionPerformed(ActionEvent e) { doSomethingElse(); System.out.println(menuLabel); } } mi.addActionListener(new MyMenuListener()); return mi; }

(Multiple Choice)
5.0/5
(36)

Given four JRadioButton objects in a ButtonGroup, how many radio buttons can be selected at the same time?

(Multiple Choice)
4.7/5
(40)

Which of the following classes have a user-editable area?

(Multiple Choice)
4.9/5
(37)

What type does the method getSelectedItem in the JComboBox classreturn?

(Multiple Choice)
4.9/5
(34)
Showing 61 - 75 of 75
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)