Hello;
I've have encountered a problem while trying to print a text within my JTextArea. Assuming that an action command fires each time a press the JButton named b1.
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(bb.getGraphics()); // Here is the Problem
if (pjob.printDialog())
{
try
{
pjob.print();
}
catch(PrinterException pe) {}
}// end if
}
});
}
public static void disableDoubleBuffering(Component c) {
RepaintManager currentManager = RepaintManager.currentManager(c);
currentManager.setDoubleBufferingEnabled(false);
}
// Re-enables double buffering globally.
public static void enableDoubleBuffering(Component c) {
RepaintManager currentManager = RepaintManager.currentManager(c);
currentManager.setDoubleBufferingEnabled(true);
}
X'S : Can anyone pls teach me how to print in JTextArea ? its an Emergency, thanks.