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:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q42: Write the statement to set the font
Q44: Write the statement to create an Arc2D.Float
Q47: BasicStroke myLine = new BasicStroke(12.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND);
Q52: The draw3DRect() method is used to draw
Q56: A Polygon object is created by defining
Q62: Write the statement to create a Rectangle2D.Float
Q65: import javax.swing.*;
import java.awt.*;
import java.awt.Color;
public class JDemoRectangles extends
Q66: Write the statement to instruct a Graphics
Q70: Write the statement to position a JLabel
Q73: import javax.swing.*;
import java.awt.*;
import java.awt.Color;
public class JDemo3DRectangles extends
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents