import java.awt.*; import javax.swing.*; public class Player extends JFrame { public Player() { super("Player"); setSize(244, 286); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); PlayerPanel fp = new PlayerPanel(); Container pane = getContentPane(); pane.add(fp); setContentPane(pane); setVisible(true); } public static void main(String[] arguments) { Player frame = new Player(); } } class PlayerPanel extends JPanel { public void paintComponent(Graphics comp) { super.paintComponent(comp); Graphics2D comp2D = (Graphics2D)comp; int width = getSize().width; int height = getSize().height; Font currentFont = new Font("Dialog", Font.BOLD, 18); comp2D.setFont(currentFont); comp2D.drawString("ARMANDO BENITEZ", width - 185, height - 30); currentFont = new Font("Dialog", Font.ITALIC, 12); comp2D.setFont(currentFont); comp2D.drawString("pitcher", width - 170, height - 10); currentFont = new Font("Dialog", Font.PLAIN, 12); comp2D.setFont(currentFont); comp2D.drawString("NEW YORK METS", width - 110, height - 10); } }