?
Solved

How to create dynamic html in java applet

Posted on 1998-01-26
2
Medium Priority
?
224 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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:
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

800 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