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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

. . .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
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    Bookmark Topic Watch Topic
  • New Topic