Java_Applet_Programs
Java_Applet_Programs
Q.1. Design an applet to demonstrate the use of radio button and checkbox.
import javax.swing.*;
bg.add(rb1); bg.add(rb2);
frame.setLayout(new java.awt.FlowLayout());
frame.setSize(200, 150);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
Q.2. Design an applet to create form using Text field, Text area, Button, and Label.
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
TextField nameField;
Button submitButton;
Label output;
add(new Label("Name:"));
add(nameField);
add(submitButton);
add(output);
submitButton.addActionListener(this);
/*
</applet>
*/