Frames
import java.awt.*; import javax.swing.*; public class FontExample extends JFrame { public FontExample() { setTitle("Font Example"); setSize(400, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public void paint(Graphics g) { super.paint(g); g.setFont(new Font("Serif", Font.BOLD, 20)); g.drawString("Serif Bold", 50, 50); g.setFont(new Font("SansSerif", Font.ITALIC, 20)); g.drawString("SansSerif Italic", 50, 100); g.setFont(new Font("Monospaced", Font.PLAIN, 20)); g.drawString("Monospaced Plain", 50, 150); } public static void main(String[] args) { ...