Exam 11: Advanced User Interfaces

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

How do you add two buttons to the south area of a frame using the BorderLayout?

(Multiple Choice)
4.9/5
(37)

____________________ are round and have a black dot when selected.

(Multiple Choice)
4.8/5
(35)

Consider the following code snippet: Class MouseClickedListener implements ActionListener { Public void mouseClicked(MouseEvent event) { Int x = event.getX(); Int y = event.getY(); Component.moveTo(x,y); } } What is wrong with this code?

(Multiple Choice)
4.8/5
(38)

A ________ is a user-interface component with two states: checked and unchecked.

(Multiple Choice)
4.8/5
(47)

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.8/5
(33)

What is the easiest way to create complex-looking GUI layouts? I use the GridBagLayout manager II nest panels, each with its own layout manager III use multiple layout managers in the same container

(Multiple Choice)
4.9/5
(29)

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

(Multiple Choice)
4.8/5
(30)

When the user selects a menu item, the menu item sends a(n) ___________________.

(Multiple Choice)
4.7/5
(32)

Which elements of creating a graphical user interface are made easier by a GUI builder? I creating event handlers II configuring component properties III adding components

(Multiple Choice)
4.7/5
(38)

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?

(Multiple Choice)
4.9/5
(31)

Which component can be added to a menu? I JMenuBar II JMenu III JMenuItem

(Multiple Choice)
4.9/5
(45)

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

(Multiple Choice)
4.8/5
(26)

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

(Multiple Choice)
4.7/5
(36)

Consider the following code snippet: Final RectangleComponent component = new RectangleComponent(); MouseListener listener = new MousePressListener(); Component.addMouseListener(listener); ______________ Mystery.add(component); Mystery.setSize(FRAME_WIDTH, FRAME_HEIGHT); Mystery.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Mystery.setVisible(true); Which of the following statements completes this code?

(Multiple Choice)
4.8/5
(38)

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)

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.8/5
(30)

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

Which GUI element allows text entry from the program user?

(Multiple Choice)
4.9/5
(39)

A(n) ____ is used to capture mouse events.

(Multiple Choice)
4.8/5
(40)

Consider the following code snippet: Class MouseClickedListener implements MouseListener { Public void mouseClicked(MouseEvent event) { Int x = event.getX(); Int y = event.getY(); Component.moveTo(x,y); } Public void mousePressed(MouseEvent event) {} Public void mouseEntered(MouseEvent event) {} Public void mouseExited(MouseEvent event) {} } What is wrong with this code?

(Multiple Choice)
4.7/5
(38)
Showing 61 - 80 of 91
close modal

Filters

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