Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question for an applet

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really appreciate your response.Thank a lot Nathan Pruett.
Take care
Thanks,
Angela
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic