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

Yes I am SCJP and I can't even compile this single line of code!!!!!

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I must be blind, or my Java compiler is whacked. Why in the name of the heavens won't this stupid code COMPILE??? I have been doing all kinds of swing stuff in this directory, and now all of a sudden this happens:
import javax.swing.*;
public class Frustrated extends JComponent implements Runnable
{
// Copied DIRECTLY from java api docs!!!
EventListenerList listenerList = new EventListenerList();
}
The compiler keeps complaining:
C:\classes\Frustrated.java:20: cannot resolve symbol
symbol : class EventListenerList
location: package swing
javax.swing.EventListenerList listenerList = new javax.swing.EventListenerList();
WHAT DO YOU MEAN YOU CAN'T RESOLVE THE CLASS EVENTLISTENERLIST ??? ITS A STANDARD JAVA CLASS!!!
GRRRRRRRRRRRRRRR!
Well, I feel a little better now ... but I think I need a new keyboard. Anyway, I would be grateful to anyone that can point out my stupidity in this case ...
Dan
 
Dan Temple
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay! I had some juice and thought about it. I got it, I got it. I thought EventListenerList was in the package javax.swing, but in reality I have to import javax.swing.event. Doh! Sorry for the short curcuit there ... it was one of those days, you know?
Dan
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dan
We all understand, it's a lot like looking for the mysterious error in your code that the compiler put there only to find out that it's really the semi-colon you forgot.
It was soemthing like that that got my assembly language book severley damaged. Of course the repeated slamming of it on the floor didn't help either.
glad you found your answer

------------------
Dave
Sun Certified Programmer for the Java� 2 Platform
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dan Temple:
... it was one of those days, you know?



God - I feel better now! Nice to know that I'm not the ONLY one who has those days.
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic