import javax.swing.*;
import java.awt.*;
public class ColorPanel extends JPanel {
public ColorPanel(Color backColor) {
setBackground(backColor);
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);
g.setColor(Color.blue);
g.drawString("hello", 100, 45);