Step 3

The third step is to build the Scrollbars and a message display area. We will do this by, first, creating the scrollbars and, second, creating a TextField in which to display messages..

Scrollbars

Scrollbar scrollbarV;
Scrollbar scrollbarH;

  public void init ( ){
// *** Build Scrollbars

    scrollbarV = new Scrollbar (Scrollbar.VERTICAL, 0, 100, 0, 1000 );
    scrollbarH = new Scrollbar (Scrollbar.HORIZONTAL, 0, 100, 0, 1000 );

// *** Build display

    outerBox.add ("South", scrollbarH);
    outerBox.add ("East", scrollbarV);

  } // end init

TextFields

TextField message;

  public void init ( ){
    message = new TextField ( "Messages Displayed Here", 80 );
    message.setEditable ( false );

// *** Build display

    bottomPanel.setLayout ( new BorderLayout ( ) );
    bottomPanel.add ( "North", scrollbarH );
    bottomPanel.add ( "South", message );
    outerBox.add ("South", bottomPanel);
    outerBox.add ("East", scrollbarV);

  } // end init

Run the applet