I am trying to print a JTextArea through a printer, but text from JTextArea is not visible in print file i.e. .xps file.
bprint.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
try {
int num;
JFrame f1 = new JFrame("PrintJob");
Toolkit tkp = p1.getToolkit();
Properties prop = new Properties();
PrintJob pjp = tkp.getPrintJo(f1, "Printjob", prop);
Graphics g = pjp.getGraphics();
p1.print(g);
g.dispose();
pjp.end();
} catch (Exception e109) {
System.out.println(e109);
}
}
});