Exam 10: Graphical User Interfaces

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

To associate an event listener with a JButton component, you must use the ___ method of the JButton class.

(Multiple Choice)
4.8/5
(43)

Which of the following statements about an inner class is true?

(Multiple Choice)
4.7/5
(44)

What happens if a text field's width is set to 10 characters and the user types more characters into it?

(Multiple Choice)
4.7/5
(31)

You have a class that extends the JComponent class. In this class you have created a painted graphical object. Your code will change the data in the graphical object. What additional code is needed to ensure that the graphical object will be updated with the changed data?

(Multiple Choice)
4.8/5
(36)

Which of the following statements will compile without error?

(Multiple Choice)
5.0/5
(32)

Which java package must be imported if a program wishes to respond to button events?

(Multiple Choice)
4.8/5
(34)

____ are generated when the user presses a key, clicks a button, or selects a menu item.

(Multiple Choice)
4.8/5
(44)

Which of the following statements about event listeners is true?

(Multiple Choice)
4.8/5
(37)

User-interface components are arranged by placing them inside ____________________.

(Multiple Choice)
4.8/5
(34)

Consider the following code snippet: Public static void main(String[] args) { Final Order myOrder = new Order(); JButton button = new JButton("Calculate"); Final JLabel label = new JLabel("Total amount due"); ) . . Class MyListener implements ActionListener { Public void actionPerformed(ActionEvent event) { ) . . } } } Which of the local variables can be accessed within the actionPerformed method?

(Multiple Choice)
4.8/5
(39)

Which statement should be added to this code fragment to ensure that the frame is shown? JFrame frame = new JFrame();

(Multiple Choice)
4.9/5
(37)

Which of the following statements is correct?

(Multiple Choice)
4.9/5
(33)

What is the nickname for the graphical user interface library in Java?

(Multiple Choice)
4.7/5
(31)

To draw an ellipse, you must include which of the following import statements?

(Multiple Choice)
4.9/5
(39)

Complete the following statement to construct a circle. Graphics g; g.____________________(x, y, width, height);

(Multiple Choice)
4.9/5
(40)

When added to the code below, which statement will set the color of the next item drawn to green? Public class ItalianFlagComponent extends JComponent { Public void paintComponent(Graphics g) { g.drawRect(100, 100, 30, 60); ) . . ____________________________ ) . . } }

(Multiple Choice)
4.7/5
(39)

When drawing complex shapes, provide a(n) ____ to set the position of the shape.

(Multiple Choice)
4.9/5
(37)

Use the ____ method to specify the height and width of a graphical component when you add it to a panel.

(Multiple Choice)
4.7/5
(21)

To build a user interface that contains multiple graphical components, the components ____.

(Multiple Choice)
4.8/5
(38)

A(n) ____ has an instance method addActionListener() for specifying which object is responsible for implementing the action associated with the object.

(Multiple Choice)
4.8/5
(33)
Showing 21 - 40 of 54
close modal

Filters

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