Java FX User Interface and Multimedia Questions 1. To set a red color for the te
ID: 3691410 • Letter: J
Question
Java FX User Interface and Multimedia Questions
1. To set a red color for the text in the label lbl, use ________.
A. lbl.setFill(Color.red);
B. lbl.setTextFill(Color.red);
C. lbl.setFill(Color.RED);
D. lbl.setTextFill(Color.RED);
2. The method ________ appends a string s into the text area ta.
A. ta.setText(s)
B. ta.appendText(s)
C. ta.append(s)
D. ta.insertText(s)
3. To wrap a line in a text area ta, invoke ________.
A. ta.setLineWrap(false)
B. ta.setLineWrap(true)
C. ta.WrapLine()
D. ta.wrapText()
E. ta.setWrapText(true)
4. ________ returns the selected item on a ComboBox cbo.
A. cbo.getSelectedIndex()
B. cbo.getSelectedItem()
C. cbo.getSelectedIndices()
D. cbo.getSelectedItems()
E. cbo.getValue()
5. The method ________ adds an item s into a ComboBox cbo.
A. cbo.add(s)
B. cbo.addChoice(s)
C. cbo.addItem(s)
D. cbo.addObject(s)
E. cbo.getItems().add(s)
6. The statement for registering a listener for processing list view item change is ________.
A. lv.getItems().addListener(e -> {processStatements});
B. lv.addListener(e -> {processStatements});
C. lv.getSelectionModel().selectedItemProperty().addListener(e -> {processStatements});
D. lv.getSelectionModel().addListener(e -> {processStatements});
7. The statement for registering a listener for processing scroll bar value change is ________.
A. sb.addListener(e -> {processStatements});
B. sb.getValue().addListener(e -> {processStatements});
C. sb.valueProperty().addListener(e -> {processStatements});
D. sb.getItems().addListener(e -> {processStatements});
8. The statement for registering a listener for processing slider change is ________.
A. sl.addListener(e -> {processStatements});
B. sl.getValue().addListener(e -> {processStatements});
C. sl.valueProperty().addListener(e -> {processStatements});
D. sl.getItems().addListener(e -> {processStatements});
Explanation / Answer
1.
To set a red color for the text in the label lbl, use lbl.setTextFill(Color.RED).
Thus, the correct option is D. lbl.setTextFill(Color.RED).
2.
The method ta.appendText(s) appends a string s into the text area ta.
Thus, the correct option is C. ta.append(s).
3.
To wrap a line in a text area ta, invoke ta.setLineWrap(true).
Thus, the correct option is B. ta.setLineWrap(true).
4.
cbo.getSelectedItem() returns the selected item on the ComboBox cbo.
Thus, the correct option is B. cbo.getSelectedItem().
5.
The method cbo.addObject(s) add an item s into a ComboBox cbo.
Thus, the correct option is D. cbo.addObject(s).
6.
The statement for registering a listener for processing list item change is lv.getSelectionModel().addListener(e->{processStatements}).
Thus, the correct option is C.
lv.getSelectionModel().addListener(e->{processStatements}).
7.
The statement for registering a listener for processing scroll bar value change is sb.getValue().addListener(e->{processStatements}).
Thus, the correct option is B. sb.getValue().addListener(e->{processStatements}).
8.
Sl.getValue().addListener(e->{processStatements}) is the stement for registering a listener for processing slider change.
Thus, the correct option is B. Sl.getValue().addListener(e->{processStatements}).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.