This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

. . .not abstract and doesnt overide abstract method actionPerfomed

 
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")
{

}
}
}
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • 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
 
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic