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 aTextField
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 initTextFields
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 initRun the applet