import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.JOptionPane;
import java.net.*;
public class User extends Applet implements ActionListener
{Label lblUser = new Label("Username:");
Label lblPass = new Label("Password:");
TextField fieldUser = new TextField("",10);
TextField fieldPass = new TextField("",10);
Button btnOk = new Button("OK");
URL order;
public void init()
{add(lblUser); add(fieldUser);
add(lblPass); add(fieldPass);
add(btnOk);
fieldPass.setEchoChar('*');
try
{order = new URL("c:/java/Order.html");
}catch(MalformedURLException e){}
btnOk.addActionListener(this);
}
public void actionPerformed(ActionEvent a)
{String user,pass;
if(a.getSource()==btnOk)
{user=fieldUser.getText();
pass=fieldPass.getText();
if((user.equals("mcdonalds")&&pass.equals("jollibee"))||(user.equals("jollibee")&&pass.equals("mcdonalds")))
{getAppletContext().showDocument(order);}
else
{JOptionPane.showMessageDialog(null,"Invalid Username/Password","Invalid",JOptionPane.ERROR_MESSAGE);}
}
}
}
my compiler tells me that there isn't any error with the code. but it still won't display the other applet.
WHAT SEEMS TO BE THE PROBLEM?:'(
can anyone help me with this?