Beginning Java with NetBeans: Chapter 22 How to develop a GUI with Swing (part 2
ID: 3716139 • Letter: B
Question
Beginning Java with NetBeans: Chapter 22
How to develop a GUI with Swing (part 2)
MULTIPLE CHOICE
[Answers are in tables – delete all but the correct answer’s cell]
Assume that you have a text field named address1. Which of the following statements gets the text from the text field and stores it in a String object named comments?
a.
comments = address1.getText();
b.
comments = address1.getString();
c.
address1.setText(comments);
d.
address1.append(comments);
To allow the user to enter data, you would use a/an
a.
label
c.
text field
b.
dialog box
d.
panel
The GridBagLayout manager
a.
lays out components from left to right.
b.
lays out components so they are all the same size.
c.
lays out components in a grid.
d.
all of the above.
When using the GridBagLayout manager, the ________________ field sets where the component is displayed if the component is smaller than the cell that is its display area.
a.
gridy
c.
gridwidth
b.
gridx
d.
anchor
On most operating systems, a JDialog component is
a.
displayed on top of its parent frame.
b.
has fewer window controls than a JFrame.
c.
does not get its own entry in the taskbar.
d.
all of the above
a.
comments = address1.getText();
b.
comments = address1.getString();
c.
address1.setText(comments);
d.
address1.append(comments);
Explanation / Answer
statements gets the text from the text field and stores it in a String object named comments?
Answer:
a. comments = address1.getText();
To allow the user to enter data, you would use a/an
Answer:
c.text field
The GridBagLayout manager
Answer:
d.all of the above.
When using the GridBagLayout manager, the ________________ field sets where the component is displayed if the component is smaller than the cell that is its display area.
Answer:
gridwidth
On most operating systems, a JDialog component is
Answer:
all of the above
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.