I am new to Java and I am trying to add print-preview in my J-frame, I tried a PrintPreview class found on given below link. But problem with this class is after creating an object to PrintPreview class it is asking for (Frame, canvas, page). In frame I pass this for my current frame, and in page "A4" but for convas I didn't getting what to pass in constructor of PrintPreview.
I opened convas2D class for which convas is referring but can't find any help?