Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need Help with this program????(java)(TextFields and Arrays)

Status
Not open for further replies.

Slink311

Programmer
Oct 16, 2001
1
US
Create an applet that displays an employees title in a TextField when the user types the employee's first names(seperated by a space) in another TextField. Include Labels for each TextField.You can use arrays to store the employees names and titles.Here is what I have thus far:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class EmployeeTitle extends Applet implements ActionListener {
String occ = ("Mechanic");
TextField tf1;
TextField tf2;
Label name = new Label("Employee Name");
Label title = new Label("Employee Title");

public void init() {
add(name);
tf1 = new TextField(20);
add(tf1);
add(title);
tf2 = new TextField(20);
add(tf2);
}

public void actionPerformed(ActionEvent e){
if(tf1==1){
String occ= tf2.getText();
}
}

}
//Please Help!!! IM going crazy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top