This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Applets and the fly likes Question for an applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Question for an applet" Watch "Question for an applet" New topic
Author

Question for an applet

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Hi,
I want to know following:
(1) Can Client open file on the server and display the text line by line in TextBox and label?
(2) Can Developer embed an applet anywhere in HTML i mean in frame, forms, Tables?
(3) Can Client open following files from the server and display it in the browser. If yes, how?:
Bitmaps, HTML or Text File or Java class or any other type like audio clip,video clip(with AWT classes).
(4) How bitmaps or text file or applets communicate with the browser?
Thanks in advance,
Angela
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Angela,
Here are the answer to your questions :
(1) Yes... you would do something like the following :

Then just read from the InputStream like it is a normal file handle and assign it to your TextBoxes or Labels.
(2) Yes, I believe the applet tag can exist anywhere in an HTML document...
(3) Kinda... you would do something like this :

However, this has to be a filetype that the browser understands, which leads into the second part of the question...
Bitmaps - Most browsers can understand graphics in GIF and JPG formats... and perhaps some others depending on the browser. IE would definately be able to display a BMP, though I am not certain about other browsers...
HTML - obviously...
Java Class - Basically you would just load a HTML page with the class you want to load specified in the pages applet tag...
Audio CLip, Video Clip - This depends on the browser... if the browser understands the format it will display... if not you may get garbage on the screen or have to download a plugin...
I'm not sure I understand what you mean by appending (with AWT classes) onto this section... If you mean can you open these filetypes inside your applet insteand of in your browser... Well some of the preceding answers would be different... i.e. Java only supports GIF, JPG, and (as of 1.3) PNG graphic formats, no problem displaying HTML or text files, if you want to dynamically load a Java class you will have to look into distributed technologies like RMI or CORBA, and I believe that something called the Java Media Framework (JMF) will play some formats of video and audio files...
(4) Basically the browser knows what files are what types. So it just downloads them from the server and displays them in the appropriate manner. The only exception is the applet... It is recognized by a special HTML tag and then is downloaded and executed in a special "panel" within the HTML document.
Anyways, hope this helps,
-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
I really appreciate your response.Thank a lot Nathan Pruett.
Take care
Thanks,
Angela
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question for an applet