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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

. . .not abstract and doesnt overide abstract method actionPerfomed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question multiple times. Let us continue the discussion here
 
rubbery bacon. rubbery tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic