Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Serialization in JTable

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
I want to send the Object of JTable from servlet/ejb to an applet.Since JTable is serialized I should be able to do this.
But ToolTipManager which is not serialized is referenced somewhere in JTable or the TableModel ,so I get a notserialized exception.
If I try to serialize an object which has references of not serialized objects may be inner classes which I am not creating ,then how do I use them?
regards,
suchitra
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if you will get this post. But here goes.
There is no need to serialize JTable ,all data in the JTabel actually resides in the TableModel.Send across the raw data itself as it may reduce network traffic and help load up your Applet speedily.In applet populate teh TableModel with this data and then construct the JTable.
This Swing Component alongwith JTree is modeled in MVC (Model-View-Contoller) pattern. The Jtable is just a GUI display ,formally called as View ,whereas the TableModel either AbstractTableModel or DefaultTableModel is the Model.The controller is generally the user ;Either via a keyboard ,mouse or another component.
Another bit of advise always try to send across whole objects which are created by you ,whose composition you can control rather than tearing out your hair and trying to make somebody else's object hierarchy work for you.
I wrote a small piece of code (kept in a static method in a Utilities class which uses Reflection) which checks that each instance variable which is not a primitive is implementing serializable. Also in such a class all parameters passed thru methods should be checked at Compile-time itself. Shift the burden as much as possibel to the Compiler.
Feel free to ask me any question,mail me as I am not sure how this site works.
Cheers
Amit

Originally posted by suchitra:
hello,
I want to send the Object of JTable from servlet/ejb to an applet.Since JTable is serialized I should be able to do this.
But ToolTipManager which is not serialized is referenced somewhere in JTable or the TableModel ,so I get a notserialized exception.
If I try to serialize an object which has references of not serialized objects may be inner classes which I am not creating ,then how do I use them?
regards,
suchitra

 
It's a tiny ad. At least, that's what she said.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic