• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

how to print a file using java codings?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all!
i want to print a file thru printer using JAVA. Is there any method or special class so that a file can be printed.
if so,kindly help me.
thankx in advance.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kalpana,
You can't exactly "print a file" in Java, but depending upon what type of data is in the file, you may be able to read its contents and print them using Java's printing capabilities. You might take a look at the java.awt.print package, and in particular, the PrinterJob class in that package. If you have trouble figuring out how to do the printing, I'd encourage you to consider picking up a copy of my book, as it contains a chapter that describes in detail how to use Java's printing capabilities.
------------------
Brett Spell
Author, Professional Java Programming
reply
    Bookmark Topic Watch Topic
  • New Topic