Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChien-wei Huang
2,995 Pointsseconds has private access to java time duration
I have checked google and all the other parts, they say sth about my class is declaring right.... the problem is that the Duration.second doens't work here, I tried Duration.ofsecods() remain fatal.....
mTimeline.getKeyFrames().add(new KeyFrame(Duration.seconds(1), e ->{
mCurrentAttempt.tick();
setTimerText(mCurrentAttempt.getmRemainingSeconds());
}));
1 Answer
Craig Dennis
Treehouse TeacherHi Chien-wei Huang !
Looks like you just have a bad import of Duration
make sure you choose the javafx.util version!
Thanks for pointing this out!
Chien-wei Huang
2,995 PointsChien-wei Huang
2,995 PointsOk so those who encounter this problem, definitely you well cause the syntax is different now, and I fixed it by observing the libraries. Should change to
I think you might wanna update this code as well :)