Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Netscape can't find javaawt/print/PrinterJob

1 view
Skip to first unread message

Bob Blum

unread,
Dec 5, 2000, 3:00:00 AM12/5/00
to
I get the error:
java.lang.NoClassDefFoundError: java/awt/print/PrinterJob
When I try and run this code on Netscape 4.76 on Windows 2000
Any idea what Netscape needs?

Bob Blum

import java.awt.*;
import java.applet.*;
import java.awt.print.*;

public class Applet1 extends Applet
{
class PrintObject implements Printable {
public int print (Graphics g, PageFormat f, int pageIndex) {
Font font =new Font("TimesRoman", Font.PLAIN, 18);
g.setFont(font);
switch (pageIndex) {
case 0 :
g.drawString("This is plain font", 10, 25);
return PAGE_EXISTS;
default:
return NO_SUCH_PAGE; // No other pages
}
}
}
public void paint(Graphics g) {
Font f =new Font("TimesRoman", Font.PLAIN, 18);
g.setFont(f);
g.drawString("This is plain font", 10, 25);
}
public void init()
{
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(new PrintObject());

if (job.printDialog())
{
try {
job.print();
}
catch (Exception e) {
System.out.println(e); }
}
}
}

Nilanjan Dutta

unread,
Dec 5, 2000, 3:00:00 AM12/5/00
to Bob Blum
Which version of JDK you are using?
I believe Netscape does not support JDK1.2.
Thanks
0 new messages