You can only use ObjectOutputStream
on objects which implement Serializable
. The SWT Text
class does not implement this.
A SWT Text
class contains all sorts of objects which depend on the native UI code, there is no way this can be saved and loaded again.