Solved

How to create dynamic html in java applet

Posted on 1998-01-26
2
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

695 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