Exam 19: Graphical User Interfaces

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

What type does the method getSelectedItem in the JComboBox class return?

Free
(Multiple Choice)
4.9/5
(38)
Correct Answer:
Verified

A

What method is required by the ChangeListener interface?

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

C

The _______ interface toolkit has a large set of user-interface components.

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

C

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

(Multiple Choice)
4.9/5
(38)

Suppose a JPanel with a BorderLayout manager contains two components: component1, which was added to the EAST, and component2, which was added to the WEST. Which parts of the JPanel appear? I North II South III Center IV West V East

(Multiple Choice)
4.9/5
(39)

Suppose a JPanel with a BorderLayout manager contains two components: component1, which was added to the CENTER, and component2, which was added to the SOUTH. Which parts of the JPanel will appear? I North II South III Center IV West V East

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.9/5
(37)

What is the best way to start using Swing components?

(Multiple Choice)
4.9/5
(35)

What is wrong with the following code? class ExitListener implements ActionListener { Public void actionPerformed(ActionEvent event) { System.exit(0); } } ActionListener exitListener = new ExitListener(); JMenu exitMenu = new JMenu("Exit"); ExitMenu.addActionListener(exitListener); JMenuBar menuBar = new JMenuBar(); MenuBar.add(exitMenu);

(Multiple Choice)
4.9/5
(33)

Which of the following adds a border to the following panel? JPanel panel = new JPanel();

(Multiple Choice)
4.8/5
(40)

What can be determined about obj from the code below? JMenuItem menuItem = new JMenuItem("Exit"); MenuItem.addActionListener(obj);

(Multiple Choice)
4.8/5
(42)

Which layout manager uses a grid, but allows selected grid locations to span multiple rows or columns? I GridBagLayout II BorderLayout III GridLayout

(Multiple Choice)
4.9/5
(42)

Which of the following statements is correct?

(Multiple Choice)
4.7/5
(38)

Which layout manager allows you to add components in different orders, with the result being the same GUI appearance? I FlowLayout II BorderLayout III GridLayout

(Multiple Choice)
4.9/5
(38)

What type of event does the JSlider class generate?

(Multiple Choice)
4.9/5
(40)

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

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.8/5
(44)

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

(Multiple Choice)
5.0/5
(36)

Which layout manager constructor call would be best-suited to create a telephone handset GUI which has three rows of three keys each with labels, 1,2,3,4,5,6,7,8,9, and a fourth row with labels *, 0, and #?

(Multiple Choice)
4.9/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
(33)
Showing 1 - 20 of 76
close modal

Filters

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