Solved

How to create dynamic html in java applet

Posted on 1998-01-26
2
214 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
ID: 1232593
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
ID: 1232594
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
micro services vs rest web services 16 85
Java Jpanels and Jframe 8 28
Oracle SQL syntax check  without executing 6 34
MySQL  on Tomcat 8 27
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…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

910 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

20 Experts available now in Live!

Get 1:1 Help Now