• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Timer wrong constructor?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im having problem with this timer:


Jeu.java:22: cannot find symbol
symbol : constructor Timer(int,Jeu)
location: class javax.swing.Timer
minuteur=new Timer(100,this);
^
1 error

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Between this and your other question I think you might be having java issues. Maybe you need to reinstall? Do this for me just for verification.

javac -version

And tell me what it says.
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here goes the result

javac 1.5.0_02
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the class compiles fine for me. I'd say you have issues with your Java install. Try reinstalling maybe?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you compiling? Command line? IDE?
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im downloading javac 1.5.0_03 now
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yet the same problem with java 1.5.0.03
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Gregg Bolinger:
How are you compiling? Command line? IDE?



command line
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I am at a loss. It compiles just fine on my PC. Same java version but Windows XP. OS shouldn't matter though.
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing you've got a weird CLASSPATH setting, maybe including an old rt.jar file, or perhaps a directory with alternative versions of your own source code.

So what does

% echo $CLASSPATH

say?
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you perhaps defined your own interface named "ActionListener"? Have you copied the Sun source someplace and recompiled it?
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
something

% echo $CLASSPATH
<empty>
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ernest Friedman-Hill:
Have you perhaps defined your own interface named "ActionListener"? Have you copied the Sun source someplace and recompiled it?



its true,
before posting in here i had this


in my source code
but after the first compilation, ive removed it
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ven this doesnt compile
http://java.sun.com/docs/books/tutorial/uiswing/events/example-1dot4/KeyEventDe mo.java
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Chitlesh GOORAH:


in my source code
but after the first compilation, ive removed it



Do this then. Delete all .class files and recompile. Make sure you don't have any class files that might reference this old Interface that you had made. I would guess that you still have a class file with your own ActionListener definition somewhere.
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hehe Gregg Bolinger,
you are the man !!
id removed all *.class
now its successfull !!!
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Chitlesh GOORAH:
hehe Gregg Bolinger,
you are the man !!





:roll:
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hehe you too Ernest Friedman-Hill
 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!