Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exception in thread "Timer-0" java.util.ConcurrentModificationException
- at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
- at java.util.HashMap$EntryIterator.next(HashMap.java:1471)
- at java.util.HashMap$EntryIterator.next(HashMap.java:1469)
- at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
- at java.util.HashSet.<init>(HashSet.java:119)
- at javafx.scene.CssStyleHelper.resetToInitialValues(CssStyleHelper.java:441)
- at javafx.scene.CssStyleHelper.createStyleHelper(CssStyleHelper.java:180)
- at javafx.scene.Node.reapplyCss(Node.java:8985)
- at javafx.scene.Node.reapplyCss(Node.java:9014)
- at javafx.scene.Node.impl_reapplyCSS(Node.java:8948)
- at javafx.scene.Node$4.invalidated(Node.java:1110)
- at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:109)
- at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:144)
- at javafx.scene.Node$4.set(Node.java:1103)
- at javafx.scene.Node$4.set(Node.java:1097)
- at javafx.scene.Node.setStyle(Node.java:1075)
- at sample.Controller.updateTimerDisplay(Controller.java:66)
- at sample.Pomodoro.handleUpdateStatus(Pomodoro.java:68)
- at sample.Pomodoro.access$600(Pomodoro.java:8)
- at sample.Pomodoro$1.run(Pomodoro.java:56)
- at java.util.TimerThread.mainLoop(Timer.java:555)
- at java.util.TimerThread.run(Timer.java:505)
- public void start() {
- timer = new Timer();
- String soundFile = "./resources/sounds/boxing_bell.wav";
- status = State.FOCUSED;
- counter = 0;
- count = new TimerTask() {
- @Override
- public void run() {
- if(!paused) {
- counter++;
- displayTimer(controller.getTimer());
- }
- if(counter == maxSeconds) {
- if (status == State.FOCUSED) {
- status = State.BREAK;
- counter = 0;
- maxSeconds = breakTime;
- Sound sound = new Sound(soundFile);
- sound.playSound();
- handleUpdateStatus(status);
- } else {
- status = State.FOCUSED;
- counter = 0;
- maxSeconds = focusTime;
- Sound sound = new Sound(soundFile);
- sound.playSound();
- handleUpdateStatus(status);
- }
- }
- }
- };
- controller.updateTimerDisplay(Controller.Color.BLACK);
- timer.scheduleAtFixedRate(count, 1000,1000);
- }
Add Comment
Please, Sign In to add comment