my
applet is always saying access denied....what is wrong....
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class Password extends Applet implements ActionListener
{
Label password = new Label("Enter your password");
TextField answer = new TextField("", 10);
public void init()
{
add(password);
add(answer);
answer.addActionListener(this);
answer.requestFocus();
}
public void actionPerformed(ActionEvent e)
{
String reply = answer.getText();
Label theOK = new Label("");
if(reply == "Rosebud")
{
theOK.setText("Access Granted");
add(theOK);
remove(answer);
invalidate();
validate();
}
else if(reply != "Rosebud")
{
theOK.setText("Access Denied");
add(theOK);
remove(answer);
invalidate();
validate();
}
}
}