This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Print JFrame with components" Watch "Print JFrame with components" New topic

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

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.....


Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis. -Jack Handy
I agree. Here's the link:
subject: Print JFrame with components
It's not a secret anymore!