It's supposed to ask for a name and password. If the name is Fred and the password is Derf, it should print good to the screen.
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;
public class MainFrame{
private Patient currentUser;
public MainFrame(){
JFrame theFrame = new JFrame("Log In");
theFrame.setSize(400, 400);
theFrame.setLocation(500, 250);
Container contentPane = theFrame.getContentPane();
contentPane.setLayout(new GridLayout(2, 2));
JLabel nameStuff = new JLabel("Enter Name");
JLabel passwordStuff = new JLabel("Enter Password");
final JTextField nameField = new JTextField();
final JPasswordField passwordField = new JPasswordField();
contentPane.add(nameStuff);
contentPane.add(nameField);
contentPane.add(passwordStuff);
contentPane.add(passwordField);
ActionListener pass = new ActionListener(){
2006-12-05
15:19:41
·
2 answers
·
asked by
ashcatash
5
in
Computers & Internet
➔ Programming & Design