Solved

Printing in a Java applet

Posted on 1998-04-06
4
480 Views
Last Modified: 2008-02-01
I am trying to write a Java applet that can print. It is easy enough to disable print security in Microsoft Internet Explorer. However, I cannot seem to find a way to do this in Netscape Navigator 4.04. Can anyone help me with this problem?
0
Comment
Question by:chieh061297
  • 2
4 Comments
 
LVL 1

Expert Comment

by:datadesign
ID: 1233948
when using jdk 1.02 simply generate a html file and open this in a new browser window, then u can print from the browser....( u can also print directly from jdk 1.02 , but then u need to know which system u r using (e.g sending a dos string to print a file) but u will have many problöems with the layout etc.
using jdk 1.1, u can use the print functionality.
0
 

Author Comment

by:chieh061297
ID: 1233949
Thank you for help. Unfortunately, I did not phrase the question correctly. We are currently implementing the applet in Java 1.1 because of its print capability. We need to use Java 1.1 because our applet must be cross-platform capable. Plus it is a graphics applet, so we have to print graphics rather than text. The applet renders a vector graphics file in real-time. We would appreciate any help you can provide. We have also increased the points on this question, since it seems harder than we first thought.

0
 
LVL 5

Accepted Solution

by:
fontaine earned 100 total points
ID: 1233950
In order to be able to print from an applet, it has to be signed. Here is some doc. about the security model used in Java 1.1:

http://www.javasoft.com/products/jdk/1.2/docs/guide/security/spec/security-spec.doc1.html#18314

Here is a page at the Netscape site intended for Java developers who are writing applets or libraries that need access to local system resources:

http://developer.netscape.com:80/docs/manuals/signedobj/capabilities/index.html

That's for the theory. The following page explains you  how to sign with an example:

http://java.sun.com/security/usingJavakey.html

If you want some sample code for printing from an applet, you can read at the end of this page:

http://developer.javasoft.com/developer/techDocs/SearchData/dd/newbie/59.html

The discussion should also interest you. Be sure to have full JDK 1.1 support before beginning:

http://developer.netscape.com/software/jdk/download.html
0
 

Author Comment

by:chieh061297
ID: 1233951
That's what we were afraid of. Signed certificate must be obtained from a third party. And for our project, we need to generate it ourself. We were hoping there is an easy way of turning off the security feature in Netscape Navigator like in Internet Explorer. I guess now the question is how do we sign our own certificates? I'll ask that in another thread.

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 95
servlet example issue 6 38
tomcat not starting 6 45
Custom Java Application connects to database: Which one of the 20? 4 27
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

813 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

11 Experts available now in Live!

Get 1:1 Help Now