import java.awt.*;
import javax.swing.*; 

public class DrawString{
    public static void main(String[] args) {
	JFrame frame = new JFrame();
	frame.setSize(500,400);
	frame.setTitle("Draw String");
	frame.getContentPane().setBackground(Color.BLACK);
	frame.getContentPane().add(new JPanel(){
		public void paintComponent(Graphics g) {
		    setOpaque(false);
		    g.setColor(Color.GREEN);
		    g.drawString("Hello world!", 100, 100);
		    g.drawLine(100,125,400,125);
		}
	    });
	frame.setVisible(true);
    }
}

