package edu.csusb.danby.applet;

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

/**
* SplashPanel provides a splash screen
* with one line of text
* @version Tue Jul 23 08:37:29 PDT 2002
*/
public class SplashPanel extends JPanel{
    protected String text;
    protected Color backgroundColor=Color.red;
    protected Color fontColor = Color.blue;
    protected Font font=new Font("Serif",Font.ITALIC, 36);

    /** 
    * SplashPanel constructor
    * @param someText is text to display on SplashPanel
    */
    public SplashPanel(String someText){
        text = someText;		
        setBackground(backgroundColor);
        }
    /**
    * paint method for panel
    * @param g the Graphics object of the panel
    */
    public void paint(Graphics g){
            setBackground(backgroundColor);
        super.paint(g); 
        g.setColor(fontColor);
        g.setFont(font);
        g.drawString(text, 45,85);
    }

    /**
    * sets the background color
    * @param color the color for the background
    */
    public void setBackgroundColor(Color color){
        backgroundColor = color;
    }
    /**
    * sets the text color
    * @param color the color for the text
    */
    public void setTextColor(Color color){
        fontColor = color;
    }
    /**
    * sets new text on the panel
    * @param text the new text
    */
    public void setText( String aText){
        text = aText;
        }
    /**
    * sets the font for the panel
    * @param font the font to be used
    */
    public void setFont(Font f){
        font =f;
    }

}
        

