x
Info
x
Warning
x
Danger
 / 
 / 
 / 
Multiple Choice    Which method called whenever the repaint method sent

Question : Multiple Choice    Which method called whenever the repaint method sent : 2043812

Multiple Choice

  1.    Which method called whenever the repaint method is sent to a JPanel object?
    1.                draw
    2.                fill
    3.                paintComponent
    4.                public static void main

  1.    Where would you find the paintComponent method?
    1.                In the JFrame class and its subclasses
    2.                In the Java2D library
    3.                In JPanel and its subclasses.
    4.                In the java Container class

  1.    Which of the following methods must be invoked after making changes to a panel for the changes to be visible to the user?
    1.                repaint();
    2.                paintComponent(aBrush);
    3.                draw(aBrush);
    4.                setVisible(true);

 

  1.    What does the Timer class in Java model?
    1.                A kitchen timer which gets set to a particular time and continues to ring until it is turned off.
    2.                A stopwatch which keeps track of the time between when it is started until it finishes.
    3.                A clock which records the current time.
    4.                The ticking of a clock or metronome, which ticks at regular intervals.
  2.    Which of the following is not a necessary step in using an instance of the javax.swing.Timer class for a simulation?
    1.                Define a class that implements the ActionListener interface and implements the actionPerformed method.
    2.                The timer must be registered with the class that implements the ActionListener interface.
    3.                The timer must be started when a subclass of the Timer class is constructed.
    4.                In the actionPerformed method the event java.event.ActionEvent e must be used in some manner.

  1.    In what class is the method public static void main(string [] args) defined?
    1.                In the JFrame class
    2.                In a subclass of the JFrame class
    3.                In the JPanel class
    4.                In a subclass of the JPanel class

  1.    Where would you find the definition of a method to draw a fish in the fish tank application?
    1.                In a subclass of the JFrame class
    2.                In a subclass of the JPanel class
    3.                In the Fish class
    4.                In the MoveTimer class

  1.    Which of the following best describes how to rotate an object in Java using swing?
    1.                Using the center point of the object as the rotation point, rotate the entire panel the specified number of degrees. Then draw the object, and rotate the entire panel, around the center point of the object, the same number of degrees in the reverse direction.
    2.                Using the upper left corner of the panel as the rotation point, rotate the entire panel the specified number of degrees. Then draw the object, and rotate the entire panel, using the upper left corner of the panel as the rotation point, the same number of degrees in the reverse direction.
    3.                Using the upper left corner of the object as the rotation point, rotate the entire panel the specified number of degrees. Then draw the object, and rotate the entire panel, using the upper left corner of the object as the rotation point, the same number of degrees in the reverse direction.
    4.                Rotate the object the specified number of degrees and then draw the object on the panel.

 

  1.    In which method  should the method getStrokeWidth() be invoked?
    1.                draw
    2.                fill
    3.                paintComponent
    4.                repaint

 

  1. Which of the following instantiations will produce an arc which is a semicircle which goes from 12 o'clock to 6 o'clock in the clockwise direction?
    1.                new java.awt.geom.Arc2D.Double(0, 0, 50, 50, 0, -180, Arc2D.CHORD)
    2.                new java.awt.geom.Arc2D.Double(0, 0, 50, 50, 0, 180, Arc2D.CHORD)
    3.                new java.awt.geom.Arc2D.Double(0, 0, 50, 50, 90, -180, Arc2D.CHORD)
    4.                new java.awt.geom.Arc2D.Double(0, 0, 50, 50, 90, 180, Arc2D.CHORD)

Solution
5 (1 Ratings )

Solved
Computer Science 3 Years Ago 176 Views
This Question has Been Answered!
Unlimited Access Free
Explore More than 2 Million+
  • Textbook Solutions
  • Flashcards
  • Homework Answers
  • Documents
Signup for Instant Access!
Ask an Expert
Our Experts can answer your tough homework and study questions
154368 Computer Science Questions Answered!
Post a Question