import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TestPanel2 extends JPanel { public void paintComponent (Graphics g) { super.paintComponent (g); // Draw the string "Hello World!" at location (50,50) g.drawString ("Hello World!", 50, 50); } }