J
Joah Senegal
Hello all,
I;m trying to do a printjob in java. But there is somthing I do not
understand.
I can;t use the Printable function. I;m using Jbuilding According to
JBuilder this function exists. When I'm trying to compile my project I'll
get the following error:
"Application1.java": cannot resolve symbol: method setPrintable
(printtest.Button1Handler,java.awt.print.PageFormat)in class
java.awt.print.PrinterJob at line 57, column 14
This is my source:
class Button1Handler
implements ActionListener {
public void actionPerformed(ActionEvent e) {
PrinterJob pjob = PrinterJob.getPrinterJob();
PageFormat pf = pjob.defaultPage();
pjob.setPrintable(this,pf);
try {
if (pjob.printDialog()) {
pjob.print();
}
} catch (PrinterException s) {
}
}
}
Does anyone have a solution for this problem?
I;m trying to do a printjob in java. But there is somthing I do not
understand.
I can;t use the Printable function. I;m using Jbuilding According to
JBuilder this function exists. When I'm trying to compile my project I'll
get the following error:
"Application1.java": cannot resolve symbol: method setPrintable
(printtest.Button1Handler,java.awt.print.PageFormat)in class
java.awt.print.PrinterJob at line 57, column 14
This is my source:
class Button1Handler
implements ActionListener {
public void actionPerformed(ActionEvent e) {
PrinterJob pjob = PrinterJob.getPrinterJob();
PageFormat pf = pjob.defaultPage();
pjob.setPrintable(this,pf);
try {
if (pjob.printDialog()) {
pjob.print();
}
} catch (PrinterException s) {
}
}
}
Does anyone have a solution for this problem?