我无法找到 Swing 组件实现 Serialized 接口(interface)背后的原理。示例:javax.swing.JComponent - 基类本身
最佳答案
根据javadoc:
http://docs.oracle.com/javase/6/docs/api/javax/swing/JComponent.html
The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.
必须提醒的是,序列化用于将对象表示为位序列,稍后您可以通过网络发送它或将其状态保存在磁盘中,因此这在某些场景(例如 RMI)中是必要的。
关于Java-Swing 序列化背后的思想,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21910724/