File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Java print! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java print!" Watch "Java print!" New topic

Java print!

Tran Tuan Hung
Ranch Hand

Joined: Apr 08, 2007
Posts: 59
I am testing on java print from java tutorial of sun. I have a problem following: I would like to print all text page in my program, but printer only print one page.
Here is code:

When i run this program in eclipse, the result is:

Line 1
Line 2
Line 50

But when i print it by printer that only print one page.
Line 1
Line 2
Line 41

So for now i want to print all text page. Please help me and sorry for my bad english
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
It is a little difficult to see what exactly you are trying to do and what your processs of mental aquisition is: I suggest three items of action:
  • Provide the uniform resource locator for the tutorial you are studying.
  • examine the if(page > 0 ) portion of code, sounds backwards.
  • Where does print(Graphics g, PageFormat pf, int page) come from, the tutorial ?
  • Where is frameToPrint developed ?
  • Check return from job.printDialog(); by testing if can

  • It appears by your code and problem that simple continued study will reveal incremental progress and continue your forward path.

    "The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
    I agree. Here's the link:
    subject: Java print!
    It's not a secret anymore!