import java.applet.*;
import java.awt.*;
import java.lang.*;
import java.util.*;
import java.io.*;
import java.net.*;


class PatienceBox extends Frame
{
	private Panel p_text;

	public StringBuffer dots;
	public Label dotLabel;

    public PatienceBox(String label)
    {
    	super(label);
    	
        setLayout(new BorderLayout());
        
        /* create and add to dialog labels */

		p_text = new Panel();
		p_text.setLayout (new GridLayout (3,0));

        Label l = new Label ("The program is working -- ", Label.CENTER);
        l.setForeground (Color.blue);
        l.setFont (new Font ("Helvetica", Font.PLAIN, 14));
        p_text.add (l);

        l = new Label ("please be patient.", Label.CENTER);
        l.setForeground (Color.blue);
        l.setFont (new Font ("Helvetica", Font.ITALIC, 14));
        p_text.add (l);

        dots = new StringBuffer("");
        dotLabel = new Label(dots.toString(), Label.LEFT);
        p_text.add("Center", dotLabel);

        add("Center", p_text);

        /* make sure dialog does not display until specifically told to */

        hide ();

    } /* end PatienceBox */


    public synchronized void paint (Graphics g)
    {
    	//int w = size().width;
        //dots.append(".");
        //System.out.println(dots);
        //String temp = dots.toString();
        //dotLabel.setText(temp);
        //if (w - g.getFontMetrics().stringWidth(temp) - 40 < 0)
        //	dots = new StringBuffer("");

    } /* end paint */


    public Insets insets()
    {
        return new Insets (30, 20, 30, 20);

    } /* end Insets */

    public void noDots()
    {
    	dots = new StringBuffer();
    	dotLabel.setText(dots.toString());
    }

} /* end PatienceBox */

