In order to display a drawing in a frame, you must define a class that extends _
ID: 3648128 • Letter: I
Question
In order to display a drawing in a frame, you must define a class that extends _______.JGraphics
JComponent
JCoordinates
JGraph
To recover the Graphics2D class from the method:
public void paintComponent(Graphics g){ }
you must include the following statement:
Graphics2D g2 = (Graphics2D) g;
Graphics2D g2 = g;
Graphics g2 = (Graphics2D) g;
Graphics g2 = (Graphics) g;
To redraw the position of a Rectangle object called box 20 units to the right and 30 units down, you would use which method?
box.move(30,20);
box.move(20,30);
box.translate(30,20);
box.translate(20,30);
Explanation / Answer
JComponent Graphics2D g2 = g; box.move(20,30);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.