Article View: borland.public.jbuilder.java.swing
Article #10952Serializing JTextField and JTextArea
From: Lars Roe
Date: Wed, 28 Jul 1999 00:00
Date: Wed, 28 Jul 1999 00:00
24 lines
1132 bytes
1132 bytes
Hello I have a problem serializing JTextField and JTextArea objects. JButtons, JScrollbars, etc. work fine. For some reason, it wants to serialize the TextUI object, which gives an error. I can circumvent the problem by removing the UI before serializing, then putting it back just afterwards, like this: javax.swing.plaf.TextUI tui = jTextField1.getUI(); jTextField1.setUI(null); oos.writeObject(comp[i]); jTextField1.setUI(tui); Why do I have to specifically do this for each text component, and not other ones? Is there a better way? TIA, Lars -- Lars Roe roex0029@tc.umn.edu
Technical Details
Message-ID:
<379F5172.F5A30734@tc.umn.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,827e73d6b27b83ab,start X-Google-Attributes: gid111d45,public From: Lars Roe <roex0029@tc.umn.edu> Subject: Serializing JTextField and JTextArea Date: 1999/07/28 Message-ID: <379F5172.F5A30734@tc.umn.edu> X-Deja-AN: 506287723 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: UM Mime-Version: 1.0 Reply-To: Lars.W.Roe-1@tc.umn.edu Newsgroups: borland.public.jbuilder.java.swing