Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java print!

 
Tran Tuan Hung
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic