• Post Reply Bookmark Topic Watch Topic
  • New Topic

identifier expected  RSS feed

 
marcelo machado
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm a newbie on Java and was trying to make an actionlistener work on a button, but i got an error "<identifier> expected". I searched the f�rum but didn't got a answer for where I put the

"btnExibir.addActionListener(new ActionListener()
{
...
"


The code is this:



Anyone can help me? Where am I wrong?

Thanks!
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
count your parens on this line:

btnExibir.addActionListener(new ActionListener()
 
marcelo machado
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, i didn't get what you say...

if you're talking about the parenthesis, the right one is below.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah crap... i hate inner classes... they get me EVERY time. forget what i said.

[hangs head in shame]
 
Chris Rudd
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are some capitalization errors and a few braces misplaced or omitted. Try this:

 
marcelo machado
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it works!

Thanks a lot!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!