Exam 20: Graphical User Interfaces

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

To create a _____ layout, you supply the number of rows and columns in the constructor, then add the components, row by row, left to right.

Free
(Multiple Choice)
4.7/5
(34)
Correct Answer:
Verified

B

What type of event does the JSlider class generate?

Free
(Multiple Choice)
4.8/5
(36)
Correct Answer:
Verified

A

If one ChangeListener is listening for three different JSlider objects, how can we determine which of the three sliders caused the event when the code enters the stateChanged method?

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

B

The ChangeEvent class defines no methods.What makes it possible to call the getSource method on a ChangeEvent object?

(Multiple Choice)
4.9/5
(40)

Based on the statement below, which of the following adds a title to the border? JPanel panel = new JPanel();

(Multiple Choice)
4.9/5
(30)

A complex GUI can be created with a set of nested panels.What should determine the components that go into a single panel?

(Multiple Choice)
4.7/5
(32)

In Java, each container has its own ____________________, which determines how the components are laid out.

(Multiple Choice)
4.8/5
(40)

When adding a component to a container with the ____ layout, specify the NORTH, EAST, SOUTH, WEST, or CENTER position.

(Multiple Choice)
4.8/5
(32)

What can you add action listeners to?

(Multiple Choice)
4.9/5
(27)

Which of the following would be an appropriate use of radio buttons when ordering a pizza?

(Multiple Choice)
4.8/5
(26)

Insert the missing code in the following segment.The code intends to get the newly selected item from the combo box. JComboBox facenameCombo = new JComboBox(); String selectedString = __________________________;

(Multiple Choice)
4.8/5
(28)

Which of the following methods returns the object that was selected in the JComboBox?

(Multiple Choice)
4.9/5
(37)

If the makeMenuItem method is called four times, at most how many different actions can be performed by these four newly created MenuItem objects when the doSomethingElse method is called? public JMenuItem makeMenuItem(String menuLabel) { JMenuItem mi = new JMenuItem(menuLabel); class MyMenuListener implements ActionListener { public void actionPerformed(ActionEvent e) { doSomethingElse(e); } } mi.addActionListener(new MyMenuListener()); return mi; }

(Multiple Choice)
4.7/5
(34)

What is the most time-effective way to build a GUI quickly and concentrate on coding the logic of the program?

(Multiple Choice)
4.7/5
(32)

If a JPanel with a BorderLayout manager contains a single component that was added to the CENTER, which parts of the JPanel does the component fill? i.North II.South III.Center IV.West v.East

(Multiple Choice)
4.9/5
(37)

Which layout manager allows you to add components to it by invoking the container's add method with the component as the only argument to add. i.FlowLayout II.BorderLayout III.GridLayout

(Multiple Choice)
4.9/5
(34)

What is the default layout manager of JPanel?

(Multiple Choice)
4.9/5
(42)

When method makeMenuItem is called, how many objects are being created? 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)
4.8/5
(43)

What is the default layout manager of the content pane of a JFrame?

(Multiple Choice)
4.8/5
(44)

Which of the following GUI objects generate(s) action events? i.JComboBox II.JRadioButton III.JButton

(Multiple Choice)
4.8/5
(31)
Showing 1 - 20 of 75
close modal

Filters

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