ratingS = new JSlider(1, 5, 3); ratingS.setMajorTickSpacing(1); ratingS.setPaintLabels(true); int vote; class SliderMoved implements ChangeListener { public void s
Setting the Compiler compliance level to 1.8 worked for me to solve a similar problem. I don't understand the reason but you may try this.
How it works:
Right click on the project --> Properties --> Java Compiler. And in java compiler properties window, set the compiler compliance level to 1.8.