I have the following code
private static Properties printProperties = new Properties();
public void print() {
PrintJob printJob = null;
try {
printJob = getToolkit().getPrintJob(this, "Draw app", printProperties);
} catch (Exception e) {
System.out.println(e.getMessage());
}
if (printJob == null)
return;
And when I'm clicking on the printing button in my menu I get a NullpointerException
, which by the PrintJob
class API is invoked by a null frame problem , If Someone can explain how to solve this problem.
Thanks for helping.