dcsimg
Communication between two Applet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rupesh_kumar
Posted On:   Friday, June 6, 2008 05:00 AM

Hi All, I am new to applet. I am facing a problem. I am trying to print graph view. I am displaying the graph view using applet. Now I am able to print that graph using PrinterJob printerJob = PrinterJob.getPrinterJob(); printerJob.setPrintable(GraphViewExplorer.this); if (printerJob.printDialog()) { try { printerJob.print(); } catch (PrinterException pe) { pe.printStackTrace(); } } But the problem is the button is also getting printed. I want to get rid of the button. Can anyone help me in this regard. Regards Rupesh    More>>

Hi All,

I am new to applet. I am facing a problem. I am trying to print graph view. I am displaying the graph view using applet. Now I am able to print that graph using


PrinterJob printerJob = PrinterJob.getPrinterJob();
printerJob.setPrintable(GraphViewExplorer.this);

if (printerJob.printDialog())
{
try
{
printerJob.print();
}
catch (PrinterException pe)
{
pe.printStackTrace();
}
}

But the problem is the button is also getting printed. I want to get rid of the button. Can anyone help me in this regard.

Regards
Rupesh

   <<Less

Re: Communication between two Applet

Posted By:   Stephen_McConnell  
Posted On:   Friday, June 6, 2008 09:45 AM

Is the button in your Applet or is it in your web page.


If the button is in your Applet, you might just be out of luck, since when you print something, it is printing the image of the applet as it is rendered. You might have to have something that makes the "button" disappear from the applet when you press "print"... before you execute the printerJob.print();


If it is part of your web page outside the applet, that can be taken care of with CSS... by declaring the Media type (you can google the exact syntax) as "screen", then it will only show up when you view it in the browser, not when you print it.


Stephen McConnell

About | Sitemap | Contact