<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.developerdotstar.com/community" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>developer.* Blogs - Printing In Java - Comments</title>
 <link>http://www.developerdotstar.com/community/node/124</link>
 <description>Comments for &quot;Printing In Java&quot;</description>
 <language>en</language>
<item>
 <title>more then one page</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-3652</link>
 <description>&lt;p&gt;Hello&lt;br /&gt;
Can you help me print more then one page.  I have everything in a jTextArea that i want printed but when i run your code it only prints the first 40 to 50 line.&lt;/p&gt;
&lt;p&gt;PrintUtilities.printComponent(jTextArea)&lt;/p&gt;
&lt;p&gt;That is how i am tunning your code.&lt;/p&gt;
</description>
 <pubDate>Thu, 18 Jan 2007 11:40:26 -0800</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 3652 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Printing multi pages</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-3651</link>
 <description>&lt;p&gt;I have a problem.  when i run your code on a jtextarea i only get one page. could there be something i am missing?&lt;/p&gt;
&lt;p&gt;Please help&lt;br /&gt;
Thanks&lt;br /&gt;
Rex&lt;/p&gt;
</description>
 <pubDate>Thu, 18 Jan 2007 11:30:42 -0800</pubDate>
 <dc:creator>RexKwanDo</dc:creator>
 <guid isPermaLink="false">comment 3651 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>HTML printing</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-3417</link>
 <description>&lt;p&gt;I have developed java code that generates html page for printing. Now it really looks weird to give print by selecting print from file option in html page. What i really want is an approach so that instead of generation of html page, when i click on print button on UI, it could print the document generated by quering db based on UI input.&lt;/p&gt;
&lt;p&gt;PS: Reply to &lt;a href=&quot;mailto:sumitsharma1983@gmail.com&quot;&gt;sumitsharma1983@gmail.com&lt;/a&gt; for this query of mine.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
</description>
 <pubDate>Sat, 13 Jan 2007 02:32:45 -0800</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 3417 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Licensing Free Code</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1583</link>
 <description>&lt;p&gt;This is not an uncommon situation. Often people post helpful snippets of code on the internet without any license restrictions at all in the hope that they&#039;ll be helpful to other developers. What are the legal restrictions on such code?&lt;/p&gt;
&lt;p&gt;For the post I&#039;ve made here I would like the particular code I&#039;ve created to be free to all without any restrictions on it whatsoever. I think that is generally the understanding when people make these sorts of posts. However, it&#039;s nice to acknowledge where you got something from. &lt;/p&gt;
&lt;p&gt;What I do when I incorporate something like this into a project is just make an acknowledgement within the code in a top-level comment. I include the author&#039;s name and the URL where the original code can be found. If you&#039;ve got a GPL project, a lot of times you&#039;ll include license information in the header of ever source file. The source file for my little utility, I think, should not include this license information but should maybe specify that this particular piece of code is not covered by the GPL. That&#039;s what I think. The Gnu people may have a different opinion. &lt;/p&gt;
&lt;p&gt;If, on the other hand, if you just learned how to make your own print utility with my code as an example, you can license it however you see fit. Again, just my opinion.&lt;/p&gt;
&lt;p&gt;PS: I&#039;m glad you find the code useful and that it&#039;ll make it into a GPL project.&lt;/p&gt;
</description>
 <pubDate>Tue, 10 Oct 2006 12:57:51 -0700</pubDate>
 <dc:creator>Rob MacGrogan</dc:creator>
 <guid isPermaLink="false">comment 1583 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>GPL Compatibility</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1580</link>
 <description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;First I would like to say that this is a very helpful utility.  I have used it in a couple projects, and it seems to work very well.&lt;/p&gt;
&lt;p&gt;I have a question about GPL compatibility with it.  I am working on a project (Buddi - buddi.sf.net) which requires printing, and I am using this class in it.  Currently I am doing a check through the source to ensure there are no copyright violations in it, and I realized that I had not contacted you previously about this class.  Is it OK for me to distribute this in a GPL&#039;d project?  If not, what is a license which I can distribute it under?&lt;/p&gt;
&lt;p&gt;Sorry I did not contact you about this earlier, and thanks in advance for your help.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
</description>
 <pubDate>Tue, 10 Oct 2006 08:14:07 -0700</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 1580 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Printing beyond the margin</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1535</link>
 <description>&lt;p&gt;You could do that by passing an extra PageFormat argument to printJob.setPrintable:&lt;/p&gt;
&lt;p&gt;(Add code to public void print(), values are arbitrary)&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;
&lt;pre&gt;  public void print() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    PrinterJob printJob = PrinterJob.getPrinterJob();&lt;br /&gt;    PageFormat format = new PageFormat();&lt;br /&gt;    // or if you like:&lt;br /&gt;    // PageFormat format = printJob.pageDialog(printJob.defaultPage());&lt;br /&gt;    Paper pp = new Paper();&lt;br /&gt;    pp.setSize(597,835);&lt;br /&gt;    pp.setImageableArea(36,36,525,763);&lt;br /&gt;    format.setPaper(pp);&lt;br /&gt;    printJob.setPrintable(this,format);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    etc.&lt;/pre&gt;&lt;/div&gt;
</description>
 <pubDate>Fri, 22 Sep 2006 14:50:38 -0700</pubDate>
 <dc:creator>acdhirr</dc:creator>
 <guid isPermaLink="false">comment 1535 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Dont works for me</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1438</link>
 <description>&lt;p&gt;I am trying to print with your class like this:&lt;/p&gt;
&lt;p&gt;new PrintUtilities(new JLabel(&quot;Test&quot;)).print();&lt;/p&gt;
&lt;p&gt;Printing is invoked right with the dialog, but only an empty white page is printed.&lt;br /&gt;
What is the problem?&lt;/p&gt;
</description>
 <pubDate>Thu, 24 Aug 2006 05:38:44 -0700</pubDate>
 <dc:creator>Daniel</dc:creator>
 <guid isPermaLink="false">comment 1438 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Question regarding your print code</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1276</link>
 <description>&lt;p&gt;First of all. You are completely right regarding printing in JAVA. At the moment Im making an application, which should print a JScrollPane. Well your code seems good, but a get a problem when printing:&lt;/p&gt;
&lt;p&gt;The whole scrollpane prints on one page, so it gets very small and unreadable. Any ways to make it larger, and print it on multiple pages... Maybe its just my problem. But at least it prints the entire scrollpane out, instead of just printing the current view. GOOD!!!&lt;/p&gt;
&lt;p&gt;im using this:&lt;br /&gt;
PrintUtilities pu = new PrintUtilities(histogram);&lt;br /&gt;
pu.printt();&lt;/p&gt;
&lt;p&gt;I cant get this function to print anything:&lt;br /&gt;
 public int print(Graphics g, PageFormat pf, int pageIndex)&lt;/p&gt;
&lt;p&gt;Do you maybe have some sample code on how to use it???&lt;/p&gt;
&lt;p&gt;I have tried to do this:&lt;br /&gt;
PageFormat pf = new PageFormat();&lt;br /&gt;
PrintUtilities pu = new PrintUtilities(histogram);&lt;br /&gt;
pu.print(histogram.getGraphics(),pf,1);&lt;/p&gt;
&lt;p&gt;nothing happens ??&lt;/p&gt;
&lt;p&gt;Please reply&lt;/p&gt;
</description>
 <pubDate>Wed, 19 Jul 2006 12:40:19 -0700</pubDate>
 <dc:creator>Henrik Moeller-Madsen</dc:creator>
 <guid isPermaLink="false">comment 1276 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>cannot say thank you enough</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1275</link>
 <description>&lt;p&gt;hi, i just want to drop a reply saying THANK YOU for your article above.&lt;/p&gt;
&lt;p&gt;i really want to thank you million for excellent effort you put in. both PSwing and printing class is EXACTLY what i am looking for in my project.&lt;/p&gt;
&lt;p&gt;again, thank you so much&lt;/p&gt;
</description>
 <pubDate>Tue, 18 Jul 2006 21:02:00 -0700</pubDate>
 <dc:creator>gen8x</dc:creator>
 <guid isPermaLink="false">comment 1275 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>How generate report in java(swing)</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1247</link>
 <description>&lt;p&gt;Hi&lt;br /&gt;
       I am kaveri, I am working in some company, just i want sample code for generate report in java, i can display my data in JTable but, number fo table colum is fixed, so i want number of  table colum diffent row diffent colum, so anybody have code for this  problem,pls send to my id kaveridpimku@gmail.com/kaveridpi_mku@yahoo.com&lt;/p&gt;
&lt;p&gt;BY&lt;br /&gt;
M.kaveri&lt;/p&gt;
</description>
 <pubDate>Tue, 04 Jul 2006 22:45:37 -0700</pubDate>
 <dc:creator>Kaveri</dc:creator>
 <guid isPermaLink="false">comment 1247 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Creating a gif out of a java Map</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1206</link>
 <description>&lt;p&gt;I want to create a gif in byte[] from a map having name value pairs like;&lt;/p&gt;
&lt;p&gt;FirstName: Joe       LastName: Doe&lt;br /&gt;
Date of Birth: 2006-23-1967&lt;br /&gt;
..&lt;/p&gt;
&lt;p&gt;any suggestions..&lt;/p&gt;
&lt;p&gt;Thanx!! in advance.&lt;/p&gt;
&lt;p&gt;-AJ&lt;/p&gt;
</description>
 <pubDate>Fri, 23 Jun 2006 10:11:25 -0700</pubDate>
 <dc:creator>AJ</dc:creator>
 <guid isPermaLink="false">comment 1206 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Many thanks for this page</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1184</link>
 <description>&lt;p&gt;As anyone in this page I struggled to print a multi page file in Java. The doc is too complicated and you feel like roaming in a desert.&lt;br /&gt;
This page is a glass of cool water! It points to the essential of printing in Java. SUN should add it to it&#039;s site as a starting example.&lt;/p&gt;
&lt;p&gt;Thanks to you. I think now I can go further by my own.&lt;/p&gt;
</description>
 <pubDate>Mon, 12 Jun 2006 03:47:59 -0700</pubDate>
 <dc:creator>Jean-Francois</dc:creator>
 <guid isPermaLink="false">comment 1184 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>unable to print from JBoss  in swings</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1170</link>
 <description>&lt;p&gt;we are trying to print data using swings, we successed in jRun , if deploy the same code in jBoss we are getting this error :&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;
&lt;pre&gt;sun.misc.ServiceConfigurationError: javax.print.PrintServiceLookup: : java.io.FileNotFoundException: &lt;a href=&quot;http://devuc.corporate.ge.com/ftlt/META-INF/services/javax.print.PrintServiceLookup&quot; title=&quot;http://devuc.corporate.ge.com/ftlt/META-INF/services/javax.print.PrintServiceLookup&quot;&gt;http://devuc.corporate.ge.com/ftlt/META-INF/services/javax.print.PrintSe...&lt;/a&gt; 	at&lt;br /&gt;sun.misc.Service.fail(Unknown Source) 	at&lt;br /&gt;sun.misc.Service.parse(Unknown Source) 	at&lt;br /&gt;sun.misc.Service.access$100(Unknown Source) 	at&lt;br /&gt;sun.misc.Service$LazyIterator.hasNext(Unknown Source) 	at&lt;br /&gt;javax.print.PrintServiceLookup$1.run(Unknown Source) 	at&lt;br /&gt;java.security.AccessController.doPrivileged(Native Method) 	at&lt;br /&gt;javax.print.PrintServiceLookup.getAllLookupServices(Unknown Source) 	at&lt;br /&gt;javax.print.PrintServiceLookup.lookupDefaultPrintService(Unknown Source) 	at&lt;br /&gt;sun.print.RasterPrinterJob.lookupDefaultPrintService(Unknown Source) 	at&lt;br /&gt;sun.awt.windows.WPrinterJob.getPrintService(Unknown Source) 	at&lt;br /&gt;sun.print.RasterPrinterJob.print(Unknown Source) 	at&lt;br /&gt;sun.print.RasterPrinterJob.print(Unknown Source) 	at&lt;br /&gt;presentation.BaseFrame.doPrint(BaseFrame.java:1068) 	at&lt;br /&gt;presentation.MainFrame.JMenuItemPrintDataSet_actionPerformed(MainFrame.java:1368) 	at&lt;br /&gt;cmpresentation.CMMainFrame.access$33(CMMainFrame.java:1) 	at&lt;br /&gt;cmpresentation.CMMainFrame$SymAction.actionPerformed(CMMainFrame.java:850) 	at&lt;br /&gt;javax.swing.AbstractButton.fireActionPerformed(Unknown Source) 	at&lt;br /&gt;javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source) 	at&lt;br /&gt;javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) 	at&lt;br /&gt;javax.swing.DefaultButtonModel.setPressed(Unknown Source) 	at&lt;br /&gt;javax.swing.AbstractButton.doClick(Unknown Source) 	at&lt;br /&gt;javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) 	at&lt;br /&gt;javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source) 	at&lt;br /&gt;java.awt.Component.processMouseEvent(Unknown Source) 	at&lt;br /&gt;java.awt.Component.processEvent(Unknown Source) 	at&lt;br /&gt;java.awt.Container.processEvent(Unknown Source) 	at&lt;br /&gt;java.awt.Component.dispatchEventImpl(Unknown Source) 	at&lt;br /&gt;java.awt.Container.dispatchEventImpl(Unknown Source) 	at&lt;br /&gt;java.awt.Component.dispatchEvent(Unknown Source) 	at&lt;br /&gt;java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 	at&lt;br /&gt;java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 	at&lt;br /&gt;java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 	at&lt;br /&gt;java.awt.Container.dispatchEventImpl(Unknown Source) 	at&lt;br /&gt;java.awt.Window.dispatchEventImpl(Unknown Source) 	at&lt;br /&gt;java.awt.Component.dispatchEvent(Unknown Source) 	at&lt;br /&gt;java.awt.EventQueue.dispatchEvent(Unknown Source) 	at&lt;br /&gt;java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) 	at&lt;br /&gt;java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 	at&lt;br /&gt;java.awt.EventDispatchThread.pumpEvents(Unknown Source) 	at&lt;br /&gt;java.awt.EventDispatchThread.pumpEvents(Unknown Source) 	at&lt;br /&gt;java.awt.EventDispatchThread.run(Unknown Source) &lt;/pre&gt;&lt;/div&gt;
</description>
 <pubDate>Tue, 06 Jun 2006 08:53:23 -0700</pubDate>
 <dc:creator>vsnn</dc:creator>
 <guid isPermaLink="false">comment 1170 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Works Great - Thanks</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1117</link>
 <description>&lt;p&gt;Just wanted to thank you for the useful print utility - it works great for me. Hopefully Sun will listen to the pain of the Java developers out there and beef up printing support since they seem to be getting more serious about Java on the desktop.&lt;/p&gt;
</description>
 <pubDate>Thu, 18 May 2006 16:22:43 -0700</pubDate>
 <dc:creator>Richard Conway</dc:creator>
 <guid isPermaLink="false">comment 1117 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Printing beyond the margin</title>
 <link>http://www.developerdotstar.com/community/node/124#comment-1081</link>
 <description>&lt;p&gt;Does anyone know how to override the page default and print in the gutter / left margin area?  I want to be able to print closer to the edge of the page, but nothing I have tried seems to have any effect on the page default, and my graphic is clipped.&lt;/p&gt;
&lt;p&gt;Any help would be appreciate!&lt;br /&gt;
Vinny&lt;/p&gt;
</description>
 <pubDate>Wed, 10 May 2006 13:29:27 -0700</pubDate>
 <dc:creator>Vinny</dc:creator>
 <guid isPermaLink="false">comment 1081 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Printing In Java</title>
 <link>http://www.developerdotstar.com/community/node/124</link>
 <description>&lt;p&gt;I&#039;ve got a solution to some tricky Java printing problems. The bottom of this post contains code that you can re-use, for free, to very easily print the multi-page contents of Java Swing components.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.developerdotstar.com/community/node/124&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.developerdotstar.com/community/node/124#comment</comments>
 <category domain="http://www.developerdotstar.com/community/taxonomy/term/18">Java</category>
 <pubDate>Wed, 16 Feb 2005 16:02:11 -0800</pubDate>
 <dc:creator>Rob MacGrogan</dc:creator>
 <guid isPermaLink="false">124 at http://www.developerdotstar.com/community</guid>
</item>
</channel>
</rss>
