wood burning stoves 2.0*
The moose likes Applets and the fly likes . . .not abstract and doesnt overide abstract method actionPerfomed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Reply locked New topic
Author

. . .not abstract and doesnt overide abstract method actionPerfomed

bothwell muyambo
Greenhorn

Joined: Oct 21, 2011
Posts: 8
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
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10266
    
    8

Please do not post the same question multiple times. Let us continue the discussion here


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: . . .not abstract and doesnt overide abstract method actionPerfomed