1.A subclass of a Swing component can customize the way the compenent is rendere
ID: 3565159 • Letter: 1
Question
1.A subclass of a Swing component can customize the way the compenent is rendered visually by overriding which of these methods?
Select one:
a. public void repaint( );
b. public void paintComponent( );
c. public void paintComponent( Graphics g );
d. public void paintComponent( Graphics2D g2 );
e. None of the above.
Question 2
Not yet answered
Marked out of 1
Flag question
Question text
In a practical system, which two MVC elements may be naturally closely related and may be combined into one class when it makes sense to do so?
Select one:
a. Model and View
b. Model and Controller
c. View and Controller
d. Any of the above pairs may be combined.
e. It is never acceptable to combine any MVC elements.
Question 3
Not yet answered
Marked out of 1
Flag question
Question text
In the Model-View-Controller architecture, which element contains the 'truth' about the system (its state) and solves the underlying problem?
Select one:
a. Model
b. View
c. Controller
d. All of the above
e. None of the above
Question 4
Not yet answered
Marked out of 1
Flag question
Question text
In the Model-View-Controller architecture, which element handles user input?
Select one:
a. Model
b. View
c. Controller
d. All of the above
e. None of the above
Question 5
Not yet answered
Marked out of 1
Flag question
Question text
In the Model-View-Controller architecture, which element maintains a list of interested viewers?
Select one:
a. Model
b. View
c. Controller
d. All of the above
e. None of the above
Question 6
Not yet answered
Marked out of 1
Flag question
Question text
What happens when a JButton is 'clicked' by the user?
Select one:
a. An ActionEvent object is created containing details of the event.
b. The JButton object sends an 'actionPerformed' message to all registered listeners, passing along the ActionEvent object in the process.
c. Objects registered as listeners may query the ActionEvent in order to gain information about the event.
d. All of the above.
e. None of the above.
Question 7
Not yet answered
Marked out of 1
Flag question
Question text
What is the purpose of a layout manager object in Java Swing?
Select one:
a. Determines the position and size of each component in a container when that container is painted on the screen.
b. Determines the hierarchy when one component is placed inside another.
c. Determines the order in which windows are painted by the operating system.
d. Allows the programmer to specify how a component should be rendered.
e. None of the above.
Question 8
Not yet answered
Marked out of 1
Flag question
Question text
What must be done in a class file so that instances of that class may be registered with a JButton as listeners?
Select one:
a. The class must directly or indirectly implement javax.swing.JButton.
b. The class must have an instance variable of type javax.swing.JButton.
c. The class must directly or indirectly extend javax.swing.JButton.
d. The class must directly or indirectly implement java.awt.event.ActionListener.
e. The class must directly or indirectly extend java.awt.event.ActionEvent.
Explanation / Answer
1.A subclass of a Swing component can customize the way the compenent is rendered visually by overriding which of these methods?
Select one:
a. public void repaint( );
b. public void paintComponent( );
c. public void paintComponent( Graphics g );
d. public void paintComponent( Graphics2D g2 );
e. None of the above.
Question 2
Not yet answered
Marked out of 1
Flag question
Question text
In a practical system, which two MVC elements may be naturally closely related and may be combined into one class when it makes sense to do so?
Select one:
a. Model and View
b. Model and Controller
c. View and Controller
d. Any of the above pairs may be combined.
e. It is never acceptable to combine any MVC elements.
Question 3
Not yet answered
Marked out of 1
Flag question
Question text
In the Model-View-Controller architecture, which element contains the 'truth' about the system (its state) and solves the underlying problem?
Select one:
a. Model
b. View
c. Controller
d. All of the above
e. None of the above
Question 4
Not yet answered
Marked out of 1
Flag question
Question text
In the Model-View-Controller architecture, which element handles user input?
Select one:
a. Model
b. View
c. Controller
d. All of the above
e. None of the above
Question 5
Not yet answered
Marked out of 1
Flag question
Question text
In the Model-View-Controller architecture, which element maintains a list of interested viewers?
Select one:
a. Model
b. View
c. Controller
d. All of the above
e. None of the above
Question 6
Not yet answered
Marked out of 1
Flag question
Question text
What happens when a JButton is 'clicked' by the user?
Select one:
a. An ActionEvent object is created containing details of the event.
b. The JButton object sends an 'actionPerformed' message to all registered listeners, passing along the ActionEvent object in the process.
c. Objects registered as listeners may query the ActionEvent in order to gain information about the event.
d. All of the above.
e. None of the above.
Question 7
Not yet answered
Marked out of 1
Flag question
Question text
What is the purpose of a layout manager object in Java Swing?
Select one:
a. Determines the position and size of each component in a container when that container is painted on the screen.
b. Determines the hierarchy when one component is placed inside another.
c. Determines the order in which windows are painted by the operating system.
d. Allows the programmer to specify how a component should be rendered.
e. None of the above.
Question 8
Not yet answered
Marked out of 1
Flag question
Question text
What must be done in a class file so that instances of that class may be registered with a JButton as listeners?
Select one:
a. The class must directly or indirectly implement javax.swing.JButton.
b. The class must have an instance variable of type javax.swing.JButton.
c. The class must directly or indirectly extend javax.swing.JButton.
d. The class must directly or indirectly implement java.awt.event.ActionListener.
e. The class must directly or indirectly extend java.awt.event.ActionEvent.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.