I have a problem in printing..
I want to print an HTML page on the printer, the file resides on the C:// and I want to send it to the printer,
when I do it i get the source code of the file which i don't want, i want a way to print the the HTML page as it is on the browser
how can I do that??
Not with that method. It's possible using the Java printing libraries, but then you'll have to format the HTML page yourself. Perhaps you can use a third party library for that.
An alternative that's slightly easier if your HTML isn't too complex, is to use JEditorPane. That one can display simple HTML pages, as long as they are HTML 3.2 compatible. It also inherits a few print methods from JTextComponent. One of these takes a PrintService and only optionally shows a dialog. You can get a PrintService reference by calling PrintServiceLookup.lookupDefaultPrintService().