• Post Reply 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

Where to put in actionPerformed?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, this is my error: CustomerStorage is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener

I am aware i don't have the actionPerformed method in but when i do but it in, the compiler tells me 'Illegal start of expression and ';' expected...

Please help!



And this is my code:


//End of Program

Thanks,
Andrew


 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Andrew Zyn wrote:I am aware i don't have the actionPerformed method in but when i do but it in, the compiler tells me 'Illegal start of expression and ';' expected...


So you have a syntax error in your code with the method added.
We need to see that code in order to tell you what the problem is.

Please UseCodeTags when posting the code.
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have added the tags, as Joanne suggested and you can see how much better it looks. I have also removed a lot of blank lines; too many blanks can make the code harder to read.
Unfortunately there are stray }}} at the end of the code. You really need to find out about indenting (one suggestion here) and stick to a convention strictly. That will make it much easier to see whether you have counted your {} correctly. Otherwise you can get weird compiler errors which you can’t understand. I haven’t counted your indents so I don’t know whether those }}} are correct or incorrect, but incorrect numbers of {} can produce “illegal start” compiler errors.

I think it is poor design to have a frame implement a Listener, so I suggest you remove that implements declaration, and find another way to create Listeners. I have written about that in the past, and you can probably find some references here.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic