After printing, can I change the contents of my JTextPane and have the same J2TextPrinter print the new contents?
Yes, but you have to call setPane again for your JTextPane before you print a second time in order to get the J2TextPrinter to recognize the new contents. This is because J2TextPrinter copies your JTextPane contents into an internal JTextPane so that it can reflow the text to the printed page width without disrupting the on-screen appearannce of your JTextPane, but it only does this the first time you print. Calling setPane will cause the J2TextPrinter to recopy your JTextPane and capture the new contents.
Related Questions
- The printer cannot perform printing since it has not been used more than one month, however, it can print normally a month ago. Why?
- After printing, can I change the contents of my JTextPane and have the same J2TextPrinter print the new contents?
- Can I print an entire cookbook instead of printing one recipe at a time?