The final local variable cannot be assigned, since it is defined in an enclosing type

前端 未结 4 818
名媛妹妹
名媛妹妹 2021-02-05 11:19
ratingS = new JSlider(1, 5, 3); 
ratingS.setMajorTickSpacing(1);
ratingS.setPaintLabels(true);
int vote;

class SliderMoved implements ChangeListener {
    public void s         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 12:02

    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.

提交回复
热议问题