PDA

View Full Version : Java login script help



Master_script_maker
12-24-2007, 03:59 PM
i am fairly new at java. can anyone help me with the button event. when someone clicks the button i need it to send the data to a php file and if the php file returns yes then the java redirects the page. is that possible?
all i have is(it is displayed 400 x 400 in the html file):
import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class login extends Applet
{
public void init()
{
setLayout(null);
nameField = new TextField();
nameField.setBounds(200, 100, 100, 20);
add(nameField);
passField = new TextField();
passField.setBounds(200, 160, 100, 20);
add(passField);
login = new Button ("Login");
login.setBackground(Color.lightGray);
login.setForeground(Color.white);
login.setBounds(210, 220, 80, 20);
add (login );
}
public void paint (Graphics g)
{
g.drawString("Name: ", 200, 95);
g.drawString("Password: ", 200, 155);
}

private TextField nameField;
private Button login;
private TextField passField;
}