Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > print at center of page?

Reply
Thread Tools

print at center of page?

 
 
terry
Guest
Posts: n/a
 
      08-23-2003
Could I add codes below so as to print "jPanelPrint" at center of page?

Thanks!


DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
PrintService printService =PrintServiceLookup.lookupDefaultPrintService();
DocPrintJob job = printService.createPrintJob();
PrintJobListener pjlistener = new PrintJobAdapter()
{
public void printDataTransferCompleted(PrintJobEvent e)
{
}
};
job.addPrintJobListener(pjlistener);
PrintRequestAttributeSet pras=new HashPrintRequestAttributeSet();

DocAttributeSet das = new HashDocAttributeSet();
Doc doc=new SimpleDoc(jPanelPrint,flavor,das);

try
{
job.print(doc,pras);
}
catch(PrintException pe)
{
pe.printStackTrace();
}

:
:
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
Naming of core NASA center with the words "Mission Control Center" & mass use of religious anthem sounding word "Mission" in Context of Space Exploration & the Moon Landing Hoax moonlandinghoaxreligious@yahoo.com Digital Photography 0 09-27-2005 08:28 PM
Can't print to print server =?Utf-8?B?cGVjaw==?= Wireless Networking 2 02-03-2005 02:41 PM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments