i've created a jframe with a jpanel with certain things as you can see in the attachment (page1.java)
..............can anyone tell how to print that jpanel(not the whole jframe) and all its contents ........
Jessurider
-10
Posting Whiz in Training
Recommended Answers
Jump to PostI'm not going to download your zip and look through it entirely. please post your relevant code and be a bit more specific as to what you want..
do you want the JPanel to be printed, or the contents of the JPanel?
Jump to PostThe trick is to get the graphics object for the printing output and then call the components paintComponent method with that object. It will draw itself on the graphics context.
Here's a sample print out to a .PS file using the following:
JFrame frameToPrint; public int …
All 6 Replies
stultuske
1,116
Posting Maven
Featured Poster
Jessurider
-10
Posting Whiz in Training
sirlink99
56
Practically a Master Poster
NormR1
563
Posting Sage
Team Colleague
Jessurider
-10
Posting Whiz in Training
NormR1
563
Posting Sage
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.