tags:

views:

33

answers:

2

Hello, I am writing my first real applet and I need to store some data. I've never really messed with putting and maintaining code on the internet, so please bear with me if I'm a little slow to catch on.

I'm building a Calendar applet for work (just a student worker) and I'm not sure how to store necessary information such as the schedules for certain days and login name and password information. I assume I have access to a server and such, but I don't know exactly what I would traditionally need or what I would need to do with what I need.

In the worst case scenario, I could simply put the information into text files and read them on every start-up where the applet is stored, but that definitely seems like a very wrong way of doing things. Can you guys educate me on a few practical ways people accomplish this in the real world. Any ideas would be greatly appreciated.

Also, as a side question. I've tested the applet class by itself and have got it to run satisfactorily in an html page with the .class file. When I want to incorporate more classes into the applet, I assume I can't use that one .class file anymore, can I? Would I have to compile everything into a .jar and use that in place of the .class file?

Thanks a lot for your help.

A: 

I see the first part of your question has been answered in another page.

Regarding the last part of your question. Nothing special is required, you can put all your class files in the same directory (assuming they are in the same package, different packages need be placed in usual Java tree on the server) and they are downloaded as required. However a Jar file is usually a better solution for multiple files. Jars are very easy (just a zipped up bunch of classes and resources if need be), can be compressed and will be downloaded in a single file.

Pool
A: 

If your applet needs to store data, it could store it in a file on the client side.

Another solution could be to connect to a remote database, or connect to a web service...

Remember that if your applet should connect to anything or write on the disk, it has to be signed.

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html

Laurent K