I want to add an Action Listener (print button) which after the action is performed will print out the whole window (GUI form).
printButton.addActionListener(new ActionListener() {
@Override
public PrinterJob actionPerformed(ActionEvent e) {
PrinterJob job = PrinterJob.getPrinterJob();
return job;
}
});
}
I have already implemented:
import java.awt.print.Printable;
The program responded with the message that the window is read-only