Constants Assignment Help

Assignment Help: >> Controls and Events - Constants

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);

}

}

2320_Constants.png

// 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);

}

}

1744_Constants1.png

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd