|
- The serializable class PaintPad does not declare a static final serialVersionUID field of type long
复制代码
代码如何写才能避免以上警告?
付代码:
- import java.awt.*;
- import javax.swing.*;
- public class PaintPad extends JFrame
- {
- JButton jbt=new JButton("OOOKKKK");
- public PaintPad()
- {
- getContentPane().setLayout(new FlowLayout());
- getContentPane().add(jbt);
- }
- public static void main(String[] args)
- {
- PaintPad f=new PaintPad();
- f.setSize(100,100);
- f.setVisible(true);
- }
- }
复制代码 |
|