Solved

Import Javax.swing.*; Import Java.awt.*;

Question 68

Essay

import javax.swing.*;
import java.awt.*;
public class JDemoFont extends JFrame
{
Font bigFont = new Font("Serif", Font.ITALIC, 48);
String hello = "Hello";
public void paint(Graphics brush)
{
super.paint(brush);
brush.setFont(bigFont);
brush.drawString(hello, 10, 100);
}
public static void main(String[] args)
{
JDemoFont frame = new JDemoFont();
frame.setSize(180, 150);
frame.setVisible(true);
}
}
The above code shows an application that uses the setFont() method with a Graphics object named brush. Describe what will occur when the two shaded lines of code are executed.

Correct Answer:

verifed

Verified

You can instruct a Graphics object to us...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents