Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4855652

Make javax.swing.Spring and javax.swing.SpringLayout.Constraints serializable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000

      Description



      Name: jl125535 Date: 04/29/2003


      A DESCRIPTION OF THE REQUEST :
      javax.swing.Spring and javax.swing.SpringLayout.Constraints should implement Serializable.

      JUSTIFICATION :
      What I need to do is create a JFrame with Swing components
      inside (JPanel's, JLabel's, etc.), to save it as an XML file
      and be able to restore it later. As of JDK 1.4, I use the
      pair XMLEncoder/XMLDecoder to manage the serialization.
      For various reasons, the most appropriate layout manager for
      my application is SpringLayout. When defining a SpringLayout
      as layout manager for a panel, this property was transferred
      to the XML by XMLEncoder and restored by XMLDecoder (as the
      class implements Serializable).

      But then, the happy days are over! In order for a
      SpringLayout to work, one must obviously define lots of
      SpringLayout.Constraints, using Springs. But none of these
      things are transferred by XMLEncoder to the XML.
      And, quite naturally, even if I modify manually the XML to
      include some constraint info, the XMLDecoder won't read that
      info!

      The problem is that the two classes (i.e.,
      javax.swing.Spring and javax.swing.SpringLayout.Constraints)
      are not implementing Serializable.

      CUSTOMER WORKAROUND :
      Extend Spring and SpringLayout.Constraints in order to implement Serializable. (I have not confirmed this approach.)
      (Review ID: 147206)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mdavidsosunw Mark Davidson (Inactive)
              Reporter:
              jleesunw Jon Lee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: