Save object state but not the data

Hi Everyone,
I'm trying to serialize a form so that I can recover the state information such as size of the form at close, size of splitpane separator, and size of each column of a JTable within the form.
However, I don't want to save the JTable's data. Also, I'm not sure about the procedure for deserialization.
For example if I have a line like:
frame.getContentPane().add(new JTable(tableModel));
next time I read the form, it already has the table within it so I shouldn't really create it or add the JTable to it, am I right?
Any comment to clarify this is really appreciated.
Thanks,
Al

Ok here is what you got to do just like createing your own subclass of JFrame
you should also create subclesses all the GUI componants you going to use in the application that need their state saved and restored.
All those class should implement a comman interface which has getState and setState (Ex:- CJTextArea, CJTextField, CJTable, CJFrame, CJInternalFrame, CJPanel .....). and thos subclasses should be used to create the widows
You will also need a several state classes for various types of components
such as
ComponentState -- Super class
ContainerState -- to hold stateobjects given by the components in a perticuler Container (ex:- JPanel)
FrameState
TextCompState -- text components (JTextField,JTextArea)
ListState
TableState
and the getStste and setSatate of the form should be written to return an object which contains the state of the form and all the other state objects returned by its nested components.
This kind of thing is done in most of the software organization in (Not just to restor the state but for many different tasks) that develop large applications with complex user interfaces.
Its worth spending some time to devalop such an API becouse it can be used in any programdeveloped after that.
The company I work has done excatly that some time ago but I cant post any code here (You know why)

Similar Messages

  • Copy database structure but not the data

    I'm looking to create a new version of a database but with completely reloaded data - so I want to retain the database structure but none of the data.
    Is there an easy way (read: without a DBA on staff) to copy an existing database structure - preferably with views and stored procedures - and not take the data along for the ride?
    Thanks in advance for suggestions...!

    My mistake Judith.
    Using Object Explorer, [Right Click] on the database,
    Select [Tasks],
    Then [Generate Scripts...]
    On the first screen, check the 'Script all objects' checkbox.
    You can either save to a file or into a window. When the scripts are finished, go to the top and change the name of the database, then run the scripts.
    That 'should' get you what you want.

  • I want an iphone, but not the data package...is this possible?

    I am a guy...I don't get to carry around a purse, and I have limited room in my pockets. I would like to get an iphone but I don't want the $30 a month data package. For some reason this is very difficult for people to understand but it is quite simple. I pretty much have access to WiFi everywhere I go, so I don't need this absurdly high priced data package. I just want to be able to use the phone itself and use the Internet and email when I am in a WiFi area as well as take pictures and have a calender etc.
    I am a current AT&T customer and I am eligible for an iphone uprage. So my question is this. Can I buy the iphone 3G, sign up for the data package (since it is required at purchase) and then cancel it soon after so I can just use it as a phone and a WiFi internet access? I would really appreciate a solid answer to this, since even the AT&T store representatives don't know how to answer this. I really don't think it's that difficult a question...
    Thanks!

    Sorry, but no. The iPhone requires a data package. You cannot get the iphone and then later take off the data package. ATT will not allow that, plus the iPhone uses the data for it's voicemail. The voicemail will only download over a data network, not wi-fi. If you can't or don't want to spend the $30/month, then the best bet is to go with another phone.
    iPhone : voice and data. Can't get one without the other
    Sorry for the bad news!

  • My pictures and music from a dead Imac are on an external hard drive. My Windows 8 sees the hard drive but not the data. How do I get the files to my PC?

    this is confusing

    Hi Bob.
    I was actually confused in trying to navigate where to ask the question in the first place within the Support Community framework. I've been away from the Apple world for many years now and obviously this world of technology moves very fast, yes? So that's the reason my opening query mentions confusion.
    Before I visited here I spent quite some time Googling the topic finding tons of answers going back MOSTLY 6-8 years all of which were fairly specific and geared toward now obsolete versions of the question or assumed my Apple computer was up and running or I had an "unformated" external hard drive.
    I didn't find anything wrong with the advice to use MacDrive but of course I was hoping not to have to use my credit card to do this------------what has to be fairly routine process. After I Googled "alternatives to MacDrive" I found a free ten day trial run for Paragon. It worked for all the picture files but can't see the old movie or music. I'm still working it out. Maybe I'm missing something. Anyways it's hard to communicate with experts who seem to want you to already be on a certain level or they will simply leave you in the dust with their "help."

  • How can I restore my data from iCal? I didn't make any backup, but I use  time machine with an external HD. I deleted iCal when I deleted my gmail account. I have tried to restore, but I can only restore the iCal software and not the data.

    How can I restore my data from iCal? I didn't make any backup, but I use  time machine with an external HD. I deleted iCal when I deleted my gmail account. I have tried to restore, but I can only restore the iCal software and not the data.

    So what is your question?
    If you forgot your encryption password:
    Warning: Make sure it's a password you will remember or write it down for safekeeping. If you encrypt an iPhone backup in iTunes and forget your password, you can't restore from backup and your data will be unrecoverable.
    If you can't remember the password and want to start again, you must perform a full software restore and chooseset up as a new device when iTunes prompts you to select the backup from which to restore.
    The above comes from here:
    http://support.apple.com/kb/HT4946

  • Is there a way to repeat an activity in the calendar monthly on the same day, i.e., the 2nd Wednesday of each month?  I can repeat on the date but not the day of the month.

    Is there a way to repeat an activity in the calendar monthly on the same day, i.e., the 2nd Wednesday of each month?  ( I can repeat on the date but not the day of the month.)

    Not with the stock calendars app.

  • Why can't I save text I've entered into a PDF file?  When I hit "Save As", only the PDF document is saved, but not the text i typed into the document.  I'm using Windows 8.

    Why can't I save text I've entered into a PDF file?  When I hit "Save As", only the PDF document is saved, but not the text i typed into the document.  I'm using Windows 8.

    THANK YOU!
    Jan Whitfield
    The College Planning Center
    250 Palladio Parkway, Suite 1311
    Folsom, CA 95630
    (916) 985-0453
    www.TheCollegePlanningCenter.com

  • How do you know what the data usage was for and why?  It shows you date and usage but not the reason.

    How can you see what data usage was for on the bill?  It only shows the date and usage but not the reason for the usage.

    You can not see this info on VZW's site. There are apps for smartphones that will break down the info though, but by site or what was downloaded

  • How to "Save for web" just the layer effect but not the content area?

    I fill the area with white, then add outter glow to the layer. Now I want to "Save for web" the outter glow effect but not the white area. I want the white area to be transparent. If I delete the white area, the layer effect goes away, if I merge the layer with another to flatten (think then I can delete the white middle while keeping the layer effect stay),  the layer effect look totally different after flatten.

    Set the fill to 0% in the layers panel (not the opacity). Then save for web as a PNG24, with transparency checked.

  • TS3212 ITunes worked fine on my Windows 7 machine.  Had to rebuild the machine but all the data remains.  Downloaded a new version of iTunes and cannot figure out how to load all of my music currently on my hard drive.  Tried moving Library file.  Did not

    ITunes worked fine on my Windows 7 machine.  Had to rebuild the machine but all the data remains.  Downloaded a new version of iTunes and cannot figure out how to load all of my music currently on my hard drive.  Tried moving "iTunes Library" file.  Did not work.  Never had trouble like this before.

    Many thanks for your post. I've been trying for days to get this sorted and was getting well fed up with I-Tunes. Really thought i'd never get it working again. Tried un-installing it, loading older versions and they still wouldn't work.
    Came across your suggestion by chance and top man - it worked..!!!!
    How you even knew what to do is beyond me - but thanks so much. I really was pulling my hair out.
    You need to put your post over the Web as there seem to be loads of people having the same trouble.
    Thanks again.

  • The calendar typeface is so dim, I can barely read it. Name of days and date, but not the items I put in. Apple says they have no fix. Anyone else have this problem? Any solutions?

    The calendar typeface is so dim, I can barely read it. Name of days and date, but not the items I put in. Apple says they have no fix. Anyone else have this problem? Any solutions?

    I agree and I found your post because I did a google search ical typeface dim.
    If I find anything out, I will post back here.

  • I am using system 10.8.2 and have an issue with the screen saver not filling the screen. the desktop does, but not the screen saver. I find adjustments for the desktop, but not the saver. Would appreciate any suggestions.

    I am using system 10.8.2 and have an issue with the screen saver not filling the screen. the desktop does, but not the screen saver. I find adjustments for the desktop, but not the saver. Would appreciate any suggestions.

    I have a group of my images that rotate, and yes it happens oneach. I do believethat I have at one time had the images cover the entire screen, however I cannor remember how I made that happen, just like the desktop. I am sure it is old'ites setting in!

  • When I look up the creation date for files on my Macbook I get the date and month in brackets, but not the year.  Why is this and how can I look up the year?

    When I look up the creation date for files on my Macbook (using "get info", or the information window in Iphoto) I get the date and month in brackets, but not the year.  Why is this and how can I look up the year? 

    Does the Date Modified column in a window set to List view show the date correctly, or does it also display it incorrectly?
    To add additional columns to a Finder (folder) window, with that window open and active open the View Options for it. You can do that by pressing Command-J or by selecting View Options from the View menu in the main menubar.

  • How Delete all the data in all BI Models, just the data but not the model

    Hi Gurus,
    i need to delete all the data of the cubes, PSA , etc , all the data of this models but not the model, how can i do this in a fast way? though a program? thanks

    Hi,
    I would prefer process chain, not program.
    Create new process chain include data target deletion component and PSA deletion component.  (Include corrosponding DSO/Cube/PSA names).
    Run process chain.
    Else you can search for FMs to delete contents from your targets.
    Delete InfoCube Data
    Regards,
    Vinay

  • I can save the USA Paper as PDF, but not the Denver Post

    I can save the USA Paper as PDF file, but not the Denver Post.
    I currently have 4.0.1 firefox.

    When you select save PDF on your PlayBook and nothing happens. On ly up Adobe Reader on the PlayBook and see if they are in there

Maybe you are looking for

  • How can I customize the URL you land on when you open a new tab

    Right now when I open a new tab the URL is (about:newtab which gives me the option to search yahoo.com) and I would like to land on www.google.com (as this is more useful for me). Can I customize the landing page for when I open new tabs?

  • Array Out of Bounds Exception. Where?

    Hello, I am developing an application using Visual Cafe 3.0. The application access a file every minute to read a new line and show data in a MultiList. First the code reads the header of the file to get all options, and then reads a new line avery m

  • How to uninstall 3rd party app from MacBook Pro?

    Does anyone know how to uninstall a 3rd party application (RMSViewer) from MacBook Pro?  The app doesn't work and I want to remove it from memory.  I can't find an "uninstall" utility on my computer and the 3rd party software doesn't include an unins

  • Mi iphone 6 plus no quiere descargar aplicaciones

    Todo estaba perfecto un dia decidi sincronizarlo a la computadora y ahi empezaron los problemas. Primero no quería descargar aplicaciones, se queda moviendose el circulo como si estubiera tratando de cargar pero nunca me pide la huella o el password

  • Cisco Call Manager DR situation

    Hello, We have 2 Cisco Call Manager in our site and place in 2 different locations connecting via a layer 2 network. They form a cluster group and the production one is the publisher and the DR one is the subscriber. In the DR situation, if the layer