• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

Java print!

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
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.
    The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
    Java file APIs (DOC, XLS, PDF, and many more)
      Bookmark Topic Watch Topic
    • New Topic