• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to get all the objects from the applet??

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody tell me how to get all the objects (buttons, table,etc) from the applet and put it into a string??
I am using JApplet with JDK 1.4
[ July 18, 2003: Message edited by: Ann Toh ]
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Ann,
what do u exactly mean by "put it in a string"?
i guess that u can probably do getComponents() on the applet object you have as JApplet or Applet objects are panels (containers) and thats how u can probably get all sub components BUT i don't know what u mean by "put it in a string"? what in reality u will want to do with such a functionality? can u explain ur ideas more?
regards
maulin
 
Ann Toh
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i mean like get all the objects from the applet and put it into a string so that when i call that function it will show me applet again.
my program is like microsoft excel, so when i open my file which i have save before. when i open it, all the objects must be there. i don know whether u understand or not but it is very difficult for me to say in words, so sorry about it.
Thanx alot.
[ July 18, 2003: Message edited by: Ann Toh ]
[ July 18, 2003: Message edited by: Ann Toh ]
 
Saloon Keeper
Posts: 25477
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The word you want is "persistence". You want your applet data be persist after you leave and come back.
There are two places to place persistent data. If you place it on your PC, you'll need a signed applet and if the PC breaks, you lose the data. Usually it's better to place the data on the server using HTTP Tunneling. You can do that without having to do any security signing.
You can't just capture the indo you need by enumerating all the controls and invoking toString() on each one. What you really want is to be able to load and store the data that they're displaying. For some controls, this is simple (for example, the getText()/setText() methods for a Swing JTextField). For some, you may have a complex data model and it will need to manage its own serialization.
The format that you use to get the data to persist to/from the server is up to you. Usually straight lines of text or XML will do it. I don't recommend binary formats, though.
ALso up to you is how to store the data once it arrives on the server. That's what J2EE's all about.
 
I didn't say it. I'm just telling you what this tiny ad said.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic