package gui;
import javax.swing.*;
Import java.awt.event.*;
import java.applet.Applet;
public class FE extends Applet implements ActionListener {
private JLabel lb = new JLabel("Enter text :");
private JTextField jtf1 = new JTextField(10);
private JButton jb = new JButton("ENTER");
private JLabel lb2 = new JLabel(" ");
public void init() {
add(lb);
add(jtf1);
add(jb);
add(lb2);
jb.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
String name = jtf1.getText();
if (e.getSource() == jb) {
}
// problem to compare a string.
//Example: i have to key in the name called "Lawrence" once i key in and i press the "Enter" button , it will show the text("Access Granted") in a Label field. If key in other name it will show ("Wrong Name").
}