0
else if (e.getSource() ==butRetrieve)
       for (int i=0;i<Store.count;i++)
       {
           u=new Employee(myStore.elementAt(i));
           if(txtName.getText().equals(u.name)) 
           {  
               u=(Employee)myStore.elementAt(0);
               txtName.setText(u.name);
               txtPhonenum.setText(u.phoneNo);
               txtNi.setText(u.natInsceNo);
              
            }   
        }

Code in red is the problem, "cannot find symbol - constructor Employee(person)". Im a java virgin so please be gentle.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by javaAddict
0

It means that such a constructor doesn't exist. Look at the Employee constructors. What do they take as argumentand what does the myStore.elementAt(i) return?

u=new Employee(myStore.elementAt(i));

Also shouldn't you be doing this:

u=(Employee)myStore.elementAt(i);
           if(txtName.getText().equals(u.name)) 
           {      
               txtName.setText(u.name);
               txtPhonenum.setText(u.phoneNo);
               txtNi.setText(u.natInsceNo);
            }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.