Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: AWT
Expertise: Beginner
Sep 15, 1998

Saving Panels with TextField?

Question:
I am writing a presentation application and want to take a Panel and add TextFields and maybe Images to it. Is it possible to save this Panel with TextFields on it to disk and reload it later without losing the size and the text of the TextFields?

Answer:
As long as all the components you add implement the Serializable interface and save their complete state, you should be able to save and restore your panel without losing its dimensions or contents. All of the basic components provided in the java.awt package as well as the com.sun.java.swing package are serializable. You just have to make sure that any new components you create are also serializable.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date