0

Am not able to find the rational behind swing components implementing Serializable interface. Example : javax.swing.JComponent - the base class itself

kushi
  • 389
  • 1
  • 5
  • 11

1 Answers1

2

According to the 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.

You must remind that Serialization is used for represent an object as a sequence of bits, later you can send this through network or save their state in disk, so this is necessary in certain scenarios like RMI.

Ernesto Campohermoso
  • 7,213
  • 1
  • 40
  • 51