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

In java language Question 1 Which pair of words completes the sentence below cor

ID: 3687969 • Letter: I

Question

In java language

Question 1

Which pair of words completes the sentence below correctly? Select all that apply.

A ________ is a( n ) ________.

a. Component, Object.

b. Container, JPanel.

c. JComponent, Container.

.d Container, Component.

Question 2

_____ provides the basic attributes and behaviors of a windowa title bar: a title bar at the top of the window, and buttons to minimize, maximize and close the window.

Select one:

a. JLabel.

b. JSwing.

c. JFrame.

d. JWindowControl.

Question 3

A JLabel can be attached to a JFrame using method ________.

Select one:

a. add

b. contain

c. append

d. attach

Question 4

Which of the following expressions creates a JLabel that displays the text:

"Here is what I look like!"

The JLabel should display Icon object face, and the JLabel’s contents should be left aligned.

Select one:

a. new JLabel("Here is what I look like!", face, SwingConstants.LEFT)

b. new JLabel("Here is what I look like!", SwingConstants.LEFT, face)

c. new JLabel("Here is what I look like!", SwingJustification.LEFT, face)

d. new JLabel("Here is what I look like!", face, SwingJustification.LEFT)

Question 5

Which methods retrieve and set the image that's displayed in a JLabel?

Select one:

a. getText, setText.

b. getResource, setResource.

c. getImageIcon, setImageIcon.

d. getIcon, setIcon.

Question 6

Which JFrame constant indicates that the program should terminate when the window is closed by the user?

Select one:

a. IMMEDIATELY_CLOSE.

b. EXIT_ON_CLOSE.

c. TERMINATE_ON_CLOSE.

d. All of the above.

Question 7

Method _____ can be used to set the layout manager of a container.

Select one:

a. setLayout

b. setManager

c. setLayoutManager

d. setGUILayout

Question 8

Forgetting to register an event-handler object for a particular GUI component’s event type causes         .

Select one:

a. events of that type to be ignored.

b. all of the GUI component's events to be ignored.

c. a compilation error.

d. None of the above.

Explanation / Answer

Q1. b) Container,JPanel

Q2. c) JFrame

Explanation: JFrame provides attributes for title bar and buttons to minimize,maximize and to close the window. And JFrame is a top-level window with title and border.

Q3. a) add

Q4. a) new JLabel("Here is what i look like!",face,SwingConstants.LEFT)

Q5. d) getIcon,setIcon

Q6. b) EXIT_ON_CLOSE

Q7. a) setLayout

Q8. a) events of that type to be ignored

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote