Solved

How to create dynamic html in java applet

Posted on 1998-01-26
2
213 Views
Last Modified: 2012-06-27
Env. VJ++ 1.1 JDK 1.02 netscape 3.01
Hi there,
 
     I am interested in printing a report from my java applet with the current data. I know that JDK 1.02 does not support printing. So what I am planning to do is create a temporary html with the data dynamically and tell user to print the html file from browser. My question is how to create a temporary dynamic html from applet? Can somebody give me some clue or better solution?

Maha
 
0
Comment
Question by:maha
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 20 total points
Comment Utility
As you know already, a Java applet can't print (under 1.02) nor will IE or Navigator properly print data displayed inside an applet.  They just don't know how to render the data and the applet can't render itself because the JDK doesn't support it.  You also can't have the applet send HTML to the browser since that violates the Java security model.  So, how can you do it?

This is what I have done.  Have the applet structure the HTML like you want it and send it back to a CGI program on the server.  The applet can then request the page back from the server and tell the browser to display it.  You can then have the server cgi program delete the temporary page after it's been displayed.  If this seems like a runaround, I agree, but these are the kind of tricks that must be played to work around the "sandbox" in Java.
0
 

Author Comment

by:maha
Comment Utility
Hi jhance,

    That sounds good. But I am pretty novice to CGI programming. Can U give some sample code or some pointers to books or sites, I would really appreciate.

Thanx
Maha

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now