•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,419 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,620 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1479 | Replies: 3
![]() |
•
•
Join Date: Feb 2006
Posts: 14
Reputation:
Rep Power: 3
Solved Threads: 0
hi everybody, cud neone here pls help me out in printing a page in Java. I have a page designed in swings which contains mainly labels and textareas. And i need to print this page in java with a click of a button. Could nebody arnd please help me out in this matter as it is very urgent and important. I will be really grateful to all the masters here.
<<snipped>>
Thanks and kind regards,
Rahul Gupta.
<<snipped>>
Thanks and kind regards,
Rahul Gupta.
Last edited by ~s.o.s~ : Apr 17th, 2007 at 1:12 pm. Reason: Keep it on site.
PrintService[] services3 = PrintServiceLookup.lookupPrintServices(null, null); AttributeSet aset3 = new HashAttributeSet(); aset3.add(new PrinterName("my printer name", null)); aset3.add(MediaTray.BOTTOM); services3 = PrintServiceLookup.lookupPrintServices(null, aset3); PrinterJob pjob = PrinterJob.getPrinterJob();
try this . it will work
Last edited by lucky1981_iway : Apr 16th, 2007 at 7:26 am.
•
•
Join Date: Feb 2006
Posts: 14
Reputation:
Rep Power: 3
Solved Threads: 0
thanks for the prompt reply. but how can I implement this with my JFrame page.???
•
•
•
•
PrintService[] services3 = PrintServiceLookup.lookupPrintServices(null, null); AttributeSet aset3 = new HashAttributeSet(); aset3.add(new PrinterName("my printer name", null)); aset3.add(MediaTray.BOTTOM); services3 = PrintServiceLookup.lookupPrintServices(null, aset3); PrinterJob pjob = PrinterJob.getPrinterJob();
try this . it will work
You want to take printout of which thing ...?
You can add print job listener to your printjob and then you can implement your own set of actions.
Or in actionPerformed of button event you can create a printjob and add it for printing.
something like this
You can add print job listener to your printjob and then you can implement your own set of actions.
Or in actionPerformed of button event you can create a printjob and add it for printing.
something like this
services3.createPrintJob(); . . . pjob.print();
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Printing using Web Control Print button. (ASP.NET)
- Printing from java (Java)
- Printing in Java (Java)
- Help needed for a printing routine (Visual Basic 4 / 5 / 6)
Other Threads in the Java Forum
- Previous Thread: Java Noob Question
- Next Thread: plz help me for applet


Linear Mode