import javax.swing.*;
import java.awt.Graphics;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.util.*;

public class writeP extends JPanel
{ 
 String s[];
 public writeP(String si)
 {super();
  s=enterStringarray(si);
 }
public static String[] enterStringarray(String s)
{        
 StringTokenizer token=new StringTokenizer(s);
 int n=token.countTokens()-1;
 int m=n+1;
 String a[]=new String[m];
 int j=0;           
 while(token.hasMoreTokens())
 {a[j++]=token.nextToken();}
  return a;
} 
 public void paintComponent(Graphics g) 
    {   super.paintComponent(g);
	    Graphics2D g2 = (Graphics2D)g;
        g2.setBackground(Color.yellow);
        for(int i=0;i<s.length;i++)
	      g2.drawString(s[i],50,50+25*i);
    }
}

