setText to Jlabel with function

后端 未结 4 871
我寻月下人不归
我寻月下人不归 2021-01-26 06:49

I am trying to settext to JLabel with a function.

The checkResults function is not working for some reason I still get errors. I have 2 classe

4条回答
  •  轮回少年
    2021-01-26 07:50

    The solution to this problem is expected needs to be

     @Override
     public String toString(){
     return Integer.toString(expected);
     }
    

    Then it needs to be set to JLabel like this,

    jl.setText(problems.toString());
    

提交回复
热议问题