Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a. button1 would be displayed at the top of the window with button 2 beneath it.

ID: 3544935 • Letter: A

Question

   a. button1 would be displayed at the top of the window with button 2 beneath it.
b. only button 1 would be displayed at the top of the window.
c. only button 2 would be displayed at the top of the window.

d. button1 and button2 would be displayed beside each other at the top of the window.

Given a JFrame object named frame with a default layout manager, what would the display look like given the following code?
            frame.add(button1, BorderLayout.NORTH);
            frame.add(button2, BorderLayout.NORTH);

Explanation / Answer

b. only button 1 would be displayed at the top of the window.