Hi JKay
I think it would be useful to send the complete code of the
CountdownTimer class and the exact line where you instantiate it (i.e.
the exact context of the "new CountdonwTimer()" statement).
Hope it helps
Mihai
JKay a écrit :
Hi all,
Having a shot at making my first independent app, but having issues
getting it to work.
Its a countdown timer app with Swing UI. I imagine the code for the
timer itself is kinda clunky, but I got it working previously with
some minor issues relating to not stopping the timer loop before
starting again. So I moved onto Timers to enable me to use stop() or
cancel() methods to end the loop.
So I now have a CountdownTimer class that extends java.util.Timer,
with a constructor
public CountdownTimer(){
}
which as far as I'm aware should allow creation of a CountdownTimer
object which will be a subclass of Timer.
In the GUI code I declare several variables, as soon as the class
declaration is out of the way, as well as creating a CountdownTimer
instance called timer1 using:
CountdownTimer timer 1 = new CountdownTimer();
Again as I understand it this should reference the constructor I
declared previously.
However, for some reason when I run the program I now get the
following error message:
SEVERE: Application class multitimer.MultiTimerApp failed to launch
java.lang.RuntimeException: Uncompilable source code - cannot find
symbol
symbol: constructor CountdownTimer(int,<anonymous
java.awt.event.ActionListener>)
location: class multitimer.MultiTimerView.CountdownTimer
at multitimer.MultiTimerView.<init>(MultiTimerView.java:418)
at multitimer.MultiTimerApp.startup(MultiTimerApp.java:21)
at org.jdesktop.application.Application$1.run(Application.java:
171)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
184)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:
122)
Exception in thread "AWT-EventQueue-0" java.lang.Error: Application
class multitimer.MultiTimerApp failed to launch
at org.jdesktop.application.Application$1.run(Application.java:
177)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
184)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:
122)
Caused by: java.lang.RuntimeException: Uncompilable source code -
cannot find symbol
symbol: constructor CountdownTimer(int,<anonymous
java.awt.event.ActionListener>)
location: class multitimer.MultiTimerView.CountdownTimer
at multitimer.MultiTimerView.<init>(MultiTimerView.java:418)
at multitimer.MultiTimerApp.startup(MultiTimerApp.java:21)
at org.jdesktop.application.Application$1.run(Application.java:
171)
... 8 more
I don't understand why it is giving a RuntimeException based on the
fact that it cannot find the constructor for CountdownTimer(int,
<anonymous java.awt.event.ActionListener>) when I've only told it to
use a CountdownTimer() constructor.
Anyone have any ideas?!
Cheers,
James
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en