Import [Link].
*;
Public class ComponentExample extends Frame {
Public ComponentExample() {
setTitle(“Component Example”);
setSize(400, 400);
setLayout(new FlowLayout());
Button button = new Button(“Submit”);
Add(button);
Label label = new Label(“Enter text:”);
Add(label);
TextField textField = new TextField(15);
[Link](“Default text”);
[Link]();
add(textField);
TextArea textArea = new TextArea(5, 20);
[Link](“This is a text area.”);
[Link](false);
add(textArea);
List list = new List(4);
[Link](“Item 1”);
[Link](“Item 2”);
[Link](“Item 3”);
[Link](“Item 4”);
Add(list);
Choice choice = new Choice();
[Link](“Choice 1”);
[Link](“Choice 2”);
[Link](“Choice 3”);
Add(choice);
Checkbox checkbox = new Checkbox(“Check me!”);
Add(checkbox);
Scrollbar scrollBar = new Scrollbar([Link], 50, 10, 0, 100);
Add(scrollBar);
setVisible(true);
Public static void main(String[] args) {
New ComponentExample();