• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Can't evaluate JCheckBox.isSelected() ?

 
Rancher
Posts: 241
Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can anyone explain why, for a javax.swing.JCheckBox jcb, the statement



produces the error



Syntax error on ";" , assert expected after this token



The API says isSelected() returns boolean, so I would think this is okay?

Many thanks, Eric

I am compiling in Eclipse and running Java 8.
 
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:
  • Quote
  • Report post to moderator
Can you post 2 lines before and after this one? Most probably the problem lies there
 
Eric Barnhill
Rancher
Posts: 241
Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the reply. The matter is cleared up.

Eclipse has automatic override placeholder text that it places if a new anonymous ActionPerformed is placed within a new anonymous ActionListener. That code threw in an extra bracket, and it was quite hard to spot.

That was why I mentioned Eclipse -- I figured it was messing with me as I have coded plenty of swing!
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic