not declare a static final serialVersionUID field
package doItMyself;
import javax.swing.*;
public class ClockView extends JFrame{
private JLabel tLabel = new JLabel();
ClockView(){
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setSize(95, 45);
this.getContentPane().add(tLabel);
this.refreshTimeDisplay();
}
protected String getDigitsAsString(int i){
String str=Integer.toString(i);
if (i <10) str= "0 "+str;
return str;
}
public void refreshTimeDisplay(){
TimeStamp t= new TimeStamp();
t.fillTimes();
String display=getDigitsAsString(t.hrs)+ ": "+getDigitsAsString(t.mins)+ ": "+getDigitsAsString(t.secs);
tLabel.setText( " "+display);
tLabel.repaint();
}
}
这段程序,报出一个警告错误:The serializable class ClockView does not declare a static final serialVersionUID field of type long
------解决方案--------------------用工具自带的quick fix
直接在警告上面点右键就行了