Subscribe to Macosxnerd101's Blog        RSS Feed
-----

Printing is a PITA

Icon 2 Comments
I began playing around with the Java Printing API for my side project over the past couple days, and overall it's pretty straight-forward in terms of sending data to the printer. However, setting up how the page displays was a pain. In order to create documents to print from your Java program, the process is the same as painting on a JComponent. It still relies on rendering each element and specifying the pixel positions. My JComponents on my GUI wouldn't neatly fit on a page because of the scrollbar when I used their built-in print() methods, so I had to render the text in a table format manually disregarding the GUI layouts. After much playing around, I finally got the text spaced appropriately and not overlapping.

Also, per popular request, I have gotten my first Java Drag-and-Drop API tutorial up. Link: http://www.dreaminco...r-and-dragging/

2 Comments On This Entry

Page 1 of 1

cfoley Icon

14 January 2011 - 05:02 PM
I remember not liking Java printing very much! Not used it in years though.
0

bcranger Icon

14 January 2011 - 09:09 PM
Ah looking forward to your DnD guide :D
0
Page 1 of 1

August 2014

S M T W T F S
      1 2
3456789
10111213141516
17181920212223
24252627282930
31      

Recent Entries

Search My Blog

12 user(s) viewing

12 Guests
0 member(s)
0 anonymous member(s)