crisoft
asked on
Printing in Java
How can I send something to the printer?
Supose you have a window with a text in it and you want it to be printed.
thanks
cristian
Supose you have a window with a text in it and you want it to be printed.
thanks
cristian
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I don´t know what is and how to use the container object. Can you give me a complete example using it?
thank you very much
cristian
1. import java.awt.*;
2. Toolkit tk = Toolkit.getDefaultToolkit(
3. PrintJob pj = tk.getPrintJob(container object,"title",null);
4. Graphics g = pj.getGraphics(container object);
5. container Object.printAll(g);
6. g.dispose();