Results 1 to 1 of 1
Thread: Print whole canvas drawings
- 09-30-2011, 09:03 AM #1Member
- Join Date
- Jun 2011
- Rep Power
Print whole canvas drawings
I have a problem with print everything of a canvas class. I explain you in details..........
I have two classes, suppose A and B. A class extends JApplet and implements all the listeners. B class extends Canvas class for drawing different geometrical shapes.
I have created an object of B class within A, and within actionPerformed() method of class A, I want to execute some code for printing all the drawings of Canvas class(B class). For this I have used getPrintJob(Frame frame, String title, width, height) method. But the problem is, getPrintJob() supports Frame object as its first parameter, neither JApplet nor Applet object.
But I need JApplet or Applet, bcoz Its need to run within browser. And another thing is, all the geometrical shapes are in 2D. //(Graphics2D)
So how can I solve it? Please give me suggestion and if it is possible for you, then provide me a working sample code.
- By JavaIsChallenging in forum AWT / SwingReplies: 0Last Post: 09-23-2011, 06:17 PM
- By bobbie in forum SWT / JFaceReplies: 0Last Post: 07-05-2009, 12:31 PM
- By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 11:04 PM
- By Deathmonger in forum New To JavaReplies: 0Last Post: 04-08-2008, 03:11 PM