Bookmark Topic Watch Topic
  • New Topic

. . .not abstract and doesnt overide abstract method actionPerfomed  RSS feed

 
bothwell muyambo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Report post to moderator
i am trying to create an applet with drop-down lists. when i compile the program the following error message appears '. . .is not abstract and doesnt overide abstract method actionPerformed. . . Here is my code . . . .help please




import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class DavidApplet extends Applet implements ActionListener //class header
{
Label fName=new Label("First Name");
TextField fNameField=new TextField(15);
Label lName=new Label("Last Name");
TextField lNameField=new TextField(15);
Label address=new Label("Address");
TextField addressField=new TextField(15);
Label city=new Label("City");
TextField cityField=new TextField(15);
Label stateName=new Label("State");
TextField stateField=new TextField(15);
Choice vehicle=new Choice();
Choice hookups=new Choice();
Label arrival=new Label("Arrival");
TextField arrivalField=new TextField(15);
Label nights=new Label("Nights");
TextField nightsField=new TextField(15);
Label zip=new Label("Zip");
TextField zipField=new TextField(15);
Button submitButton=new Button("Submit");
Button clearButton=new Button("Clear");

public void init()
{
Color mine=new Color(255,100,50);
setBackground(mine);
this.setLayout(new GridLayout(6,4));
add(fName);
add(fNameField);
add(vehicle);
vehicle.add("tent");
vehicle.add("pop-up");
vehicle.add("travel trailer");
vehicle.add("fifth-wheel");
vehicle.add("motor home");
add(lName);
add(lNameField);
add(hookups);
hookups.add("water only");
hookups.add("water and electricity");
hookups.add("full hookups");
hookups.add("no hookups");
add(address);
add(addressField);
add(arrival);
add(arrivalField);
add(city);
add(cityField);
add(nights);
add(nightsField);
add(stateName);
add(stateField);
add(zip);
add(zipField);
add(submitButton);
submitButton.addActionListener(this);
add(clearButton);
clearButton.addActionListener(this);
}

public void actionPerfomed(ActionEvent e)
{
String arg=e.getActionCommand();
if(arg=="Submit")
{

}
if(arg=="Clear")
{

}
}
}
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question multiple times. Let us continue the discussion here
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!