import java.applet.Applet;
import java.awt.*;

/*
<APPLET
    CODE=scrollpane.class
    WIDTH=200
    HEIGHT=200 >
</APPLET>
*/

public class scrollpane extends Applet 
{

    ScrollPane scrollpane1;
    TextPanel t1;

    public void init(){
        scrollpane1 = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);

        t1 = new TextPanel();
        scrollpane1.add(t1);
        add(scrollpane1);
    }
}

class TextPanel extends Panel
{
    public Dimension getPreferredSize()
    {
        return new Dimension(400, 400);
    }

    public void paint (Graphics g)
    {
        g.drawString ("This is a long string of text that just " +
            "seems to go on and on and on and on....", 0, 60);
    }
}
