- import java.applet.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.*;
- import javax.swing.JRadioButton;
- import javax.swing.JToggleButton;
- public class Hello extends Applet
- {
- Label l1 = new Label("USER NAME");
- TextField t1 = new TextField(10);
- Label l2 = new Label("PASSWORD");
- TextField t2 = new TextField(10);
- JToggleButton b1 = new JToggleButton("LOGIN");
- JRadioButton b2 = new JRadioButton();
- Checkbox c1 = new Checkbox();
- public void init()
- {
- add(l1);
- add(t1);
- add(l2);
- add(t2);
- add(b1);
- add(b2);
- add(c1);
- l1.setBackground(Color.RED);
- l1.setForeground(Color.GREEN);
- t1.setBackground(Color.BLUE);
- t1.setForeground(Color.CYAN);
- l2.setBackground(Color.magenta);
- l2.setForeground(Color.cyan);
- t2.setBackground(Color.YELLOW);
- t2.setForeground(Color.BLUE);
- b1.setBackground(Color.ORANGE);
- }
- }
This code snippet for Simple JAVA Applet.
