Exam 11: Advanced User Interfaces

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

What is the default layout manager of JPanel?

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

A

The code below will not compile successfully unless the argument to the makeMenuItem method is final. Why not? Public JMenuItem makeMenuItem(final String menuLabel) { JMenuItem mi = new JMenuItem(menuLabel); Class MyMenuListener implements ActionListener { Public void actionPerformed(ActionEvent

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

C

Which layout manager may change the location and size of existing components when new ones are added? I FlowLayout II BorderLayout III GridLayout

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

B

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
(35)

Which component can generate action events? I JMenuBar II JMenu III JMenuItem

(Multiple Choice)
4.8/5
(35)

Which class has constants called NORTH and SOUTH?

(Multiple Choice)
4.8/5
(30)

Consider the following code snippet: Public class MyMouseListener implements MouseListener { Public void mousePressed(MouseEvent event) { Double x; Double y; _______ System.out.println("x: " + x + ", y: " + y); } ) . . } Which of the following statements should be filled in the blank to print out where the mouse was pressed?

(Multiple Choice)
4.9/5
(32)

Suppose listener is an instance of a class that implements the MouseListener interface. How many methods does listener have?

(Multiple Choice)
4.9/5
(31)

Consider the following code snippet: Class MyListener implements ActionListener { Public void actionPerformed(ActionEvent event) { System.out.println(event); } } timer t = new Timer(interval, listener); t.start(); What is wrong with this code?

(Multiple Choice)
4.8/5
(34)

A ____ is a combination of a list and a text field.

(Multiple Choice)
4.7/5
(37)

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.

(Multiple Choice)
4.8/5
(33)

Consider the code snippet below: Public class RectangleComponent extends JComponent { Private static final int RECTANGLE_WIDTH = 20; Private static final int RECTANGLE_HEIGHT = 30; Private int xLeft; Private int yTop; Public RectangleComponent() { xLeft = 0; yTop = 0; } Public void paintComponent(Graphics g) { g.fillRect(xLeft, yTop, RECTANGLE_WIDTH, RECTANGLE_HEIGHT); } Public void moveRectangleBy(int dx, int dy) { xLeft = xLeft + dx; yTop = yTop + dy; repaint(); } } Which statement(s) causes the rectangle to appear at an updated location?

(Multiple Choice)
4.9/5
(44)

For a new programmer using the Swing JSlider component for the first time, which of these is the least important thing to know?

(Multiple Choice)
4.8/5
(33)

Which layout manager places objects left-to-right, row by row into a fixed set of rows and columns?

(Multiple Choice)
4.9/5
(40)

What is the best way to discover the set of Swing components?

(Multiple Choice)
4.8/5
(38)

Which of the following is not a visual component?

(Multiple Choice)
4.8/5
(31)

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
(39)

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
(31)

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

(Multiple Choice)
4.9/5
(40)

The Timer class is found in the ____ package.

(Multiple Choice)
4.9/5
(31)
Showing 1 - 20 of 91
close modal

Filters

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