In this video, we will learn how to create a Text box and display it in the AWT Frame Window.
Create a TextField and Display it
1 2 3 4 5 6 7 8 |
import java.awt.TextField; //Sample 01: Create a TextField and add it to Frame Window TextField txt1 = new TextField(15); add(txt1); //Sample 02: Display initial Text txt1.setText("Type Your Name"); |
Categories: AWT-Tube