aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Print JFrame with components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Print JFrame with components" Watch "Print JFrame with components" New topic
Author

Print JFrame with components

Jude Fawly
Ranch Hand

Joined: Dec 01, 2004
Posts: 33
Hi There,
can somebody help me. my deadline is on the next Sunday.

how can i print my jframe with all the components on it like a jtable.
can you provide me with a code fragment for that.
I read the printing API but it is hard for me.


Teach me to die that so I may<br />Rise glorious at the awful day
Dave Mace
Greenhorn

Joined: Jan 04, 2005
Posts: 11
A little late, but I'll leave this here for reference:

//pertinent code only




Note: Your class needs to implement Printable

It's a little dirty, but it's rather old code from when I was learning Java and I didn't double-check it as I posted it here, but it's working in my application so.....

David


Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis. -Jack Handy
 
jQuery in Action, 2nd edition
 
subject: Print JFrame with components