问题The serializable class PaintFrame does not declare a static final serialVersionUID field of type long

工具为vscode,尝试创建一个居中的窗口时显示一个问题

The serializable class PaintFrame does not declare a static final serialVersionUID field of type long Java(536871008) [6, 14]

上网查了一下,都说是Eclipse的问题,但我用的是vscode,所以比较懵圈

import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JFrame;

public class PaintFrame extends JFrame{

    public static void main(String[] args) {
        new PaintFrame();
    }

    public PaintFrame() {
        int windowWidth = 1600;
        int windowHeight = 900;

        Dimension d = new Toolkit.getDefaultToolkit().getScreenSize();
        int screenWidth = d.width;
        int screenHeight = d.height;

        setTitle("画板");
        setSize(windowWidth, windowHeight);
        setResizable(false);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLocation((screenWidth - windowWidth) / 2, (screenHeight - windowHeight) / 2);
    }
}

根据提示可先在public static void main前加上类似如下代码

 private static final long serialVersionUID = -3206065828593806732L;