Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Java print!

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic