Welcome to JavaRanch, Bhavin! I'm not exactly sure I understand your question. Are you asking about how to print an xthml document from Java, so that the printed page appears as a web browser, such as Internet Explorer, would interpret it? To start to get familiar with Java's printing API, you might want to take a look at a 5 part series of articles on printing in Java by Jean-Pierre Dub� at JavaWorld.
Note that JEditorPane can interpret and display HTML documents, but I've read that it only supports HTML up to version 3.2 and it doesn't interpret XHTML correctly. I've noticed a couple of commercial APIs for Java that can handle XHTML correctly, including one from grand-rapid developers. Perhaps someone over in the Swing / JFC / AWT forum has some ideas. I'm moving this thread there now... [ December 21, 2003: Message edited by: Dirk Schreckmann ]