problem trying to compile a simple logon program

hello.

i have developed a simple logon program. when i try to compile the program, i get 5 errors (errors + code are shown below). what are causing these errors and how can they be fixed?

-jGRASP exec: javac -g E:\CP4B Project\LogOn.java

LogOn.java:50: cannot find symbol

symbol: variable logOn

logOn = null;

^

LogOn.java:72: cannot find symbol

symbol : method setVisible(boolean)

location: class User

setVisible(false);

^

LogOn.java:83: cannot find symbol

symbol : method setVisible(boolean)

location: class User

setVisible(false);

^

LogOn.java:109: cannot find symbol

symbol : method setVisible(boolean)

location: class Administrator

setVisible(false);

^

LogOn.java:120: cannot find symbol

symbol : method setVisible(boolean)

location: class Administrator

setVisible(false);

^

5 errors

-jGRASP wedge2: exit code for process is 1.

-jGRASP: operation complete.

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

publicclass LogOnextends JFrame{

JTextField jtfUN =new JTextField(20);

JPasswordField jtfPW =new JPasswordField(20);

JButton jbOK =new JButton("OK");

JButton jbCancel =new JButton("Cancel");

public LogOn(){

super("Welcome to Home Entertainment");

setSize(250, 250);

setDefaultCloseOperation(EXIT_ON_CLOSE);

JPanel jp =new JPanel();

JLabel unLabel =new JLabel("Username: ");

JLabel pwLabel =new JLabel("Password: ");

jp.add(unLabel);

jp.add(jtfUN);

jp.add(pwLabel);

jp.add(jtfPW);

jp.add(jbOK);

jp.add(jbCancel);

setContentPane(jp);

pack();

jbOK.addActionListener(new ActionListener(){

publicvoid actionPerformed(ActionEvent e){

User u =new User();

u.doLogOn();

u.username = jtfUN.getText().trim();

u.password =new String(jtfPW.getPassword());

Administrator a =new Administrator();

a.doLogOn();

a.username = jtfUN.getText().trim();

a.password =new String(jtfPW.getPassword());

}

});

jbCancel.addActionListener(new ActionListener(){

publicvoid actionPerformed(ActionEvent e){

logOn =null;

setVisible(false);

}

});

}

publicstaticvoid main(String[] args){

LogOn logOn =new LogOn();

}

}

class User{

String username;

String password;

String[] userUsernameArray ={"Ann Smyth","John Murphy"};

String[] userPasswordArray ={"1","2"};

publicvoid doLogOn(){

int i, j;

for(i = 0; i < userUsernameArray.length; i++){

if(username.equals(userUsernameArray[i])){

setVisible(false);

//UserMainMenu umm = new UserMainMenu();

//umm.setVisible(true);

}

else{

JOptionPane.showMessageDialog(null,"Error\n\nYou have entered an incorrect username and/or password\nPlease try again", null, JOptionPane.ERROR_MESSAGE);

}

}

for(j = 0; j < userPasswordArray.length; j++){

if(password.equals(userPasswordArray[j])){

setVisible(false);

//UserMainMenu umm = new UserMainMenu();

//umm.setVisible(true);

}

else{

JOptionPane.showMessageDialog(null,"Error\n\nYou have entered an incorrect username and/or password\nPlease try again", null, JOptionPane.ERROR_MESSAGE);

}

}

}

}

class Administrator{

String username;

String password;

String[] adminUsernameArray ={"Administrator"};

String[] adminPasswordArray ={"0"};

publicvoid doLogOn(){

int k, l;

String username;

String password;

String[] adminUsernameArray ={"Administrator"};

String[] adminPasswordArray ={"0"};

for(k = 0; k < adminUsernameArray.length; k++){

if(username.equals(adminUsernameArray[k])){

setVisible(false);

//AdminMainMenu amm = new AdminMainMenu();

//amm.setVisible(true);

}

else{

JOptionPane.showMessageDialog(null,"Error\n\nYou have entered an incorrect username and/or password\nPlease try again", null, JOptionPane.ERROR_MESSAGE);

}

}

for(l = 0; l < adminPasswordArray.length; l++){

if(password.equals(adminPasswordArray[l])){

setVisible(false);

//AdminMainMenu amm = new AdminMainMenu();

//amm.setVisible(true);

}

else{

JOptionPane.showMessageDialog(null,"Error\n\nYou have entered an incorrect username and/or password\nPlease try again", null, JOptionPane.ERROR_MESSAGE);

}

}

}

}

[8768 byte] By [james-mcfaddena] at [2007-11-27 10:23:14]
# 1

I started to answer you in your other, identical thread. Was there a reason you chose to ignore my answer and re-post in another forum? You're not doing yourself any favours you know!

georgemca at 2007-7-28 17:20:46 > top of Java-index,Java Essentials,New To Java...
# 2

forgive me for saying this, but i am new to using arrays with swing in situations like this.

james-mcfaddena at 2007-7-28 17:20:46 > top of Java-index,Java Essentials,New To Java...
# 3

> forgive me for saying this, but i am new to using

> arrays with swing in situations like this.

That's irrelevant. I was trying to teach you how to solve these errors on your own, but you chose to ignore that. Why? I assumed that might be useful, given that I find it useful myself

georgemca at 2007-7-28 17:20:46 > top of Java-index,Java Essentials,New To Java...
# 4

You also post this problem in the swing forum.

Yannixa at 2007-7-28 17:20:46 > top of Java-index,Java Essentials,New To Java...
# 5

hello yannix.

i'm very sorry to be a pain in the neck. but this is the first time i am developing a login screen in Java. i hope that you can understand when i say that i have no previous experience in developing login screens.

james-mcfaddena at 2007-7-28 17:20:46 > top of Java-index,Java Essentials,New To Java...
# 6

> hello yannix.

> i'm very sorry to be a pain in the neck. but this is

> the first time i am developing a login screen in

> Java. i hope that you can understand when i say that

> i have no previous experience in developing login

> screens.

I don' wish to be rude, James, but that is completely irrelevant. Your actual problem is that you don't know how to interpret compiler errors. I have offered to help you with that, but you ignored that offer. This is akin to telling a breakdown recovery service that you don't know what is wrong with your car because you've never driven to Wakefield before!

Simply telling you how to fix these specific errors won't do you any good at all. Showing you how to make use of the error reports will be very useful to you forever. Which would you prefer? In my estimation, there is about the same amount of effort involved in either

georgemca at 2007-7-28 17:20:46 > top of Java-index,Java Essentials,New To Java...