Constants:
public static final int SCROLLBARS_BOTH
public static final int SCROLLBARS_VERTICAL_ONLY
public static final int SCROLLBARS_HORIZONTAL_ONLY
public static final int SCROLLBARS_NONE
the TextField and TextArea both gives the subsequent methods
int getColumns( )
void setColumns(int columns)
The text component class does not provide any public constructors and is therefore uninstantiable.
// Illustrating TextArea
import java.awt.*;
import java.applet.*;
public class TextAreaApplet extends Applet
{
public void init ( )
{
TextArea display = new TextArea(10,6);
display.setFont(new("Monospaced",Font.PLAIN, 12);
display.setText("Mono\n123456\nBanana\n");
display.setEditable(false);
add(display);
}
}
// illustrating Text Lines and Variable Pitch Fonts
import java.awt.*;
import java.applet.*;
public class TextAreaAppletTwo extends Applet
{
public void init ( )
{
TextArea display1 = new TextArea(4,6);
display1.setFont(new("Monospaced",Font.PLAIN, 18);
display1.setText("Mono\n123456\nBanana\n");
TextArea display2 = new TextArea(4,6);
display2.setFont(new("Monospaced",Font.PLAIN, 18);
display2.setText("Mono\n123456\nBanana\n");
TextArea display3 = new TextArea(4,6);
display3.setFont(new("Monospaced",Font.PLAIN, 18);
display3.setText("Mono\n123456\nBanana\n");
add(display1);
add(display2);
add(display3);
}
}