Results 1 to 6 of 6
- 08-21-2009, 04:12 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
Importing text into a word document
Hello again,
I was just wondering is there any way to import a block of text ( say from a JTextArea or something similar) into a word document and still keep its layout? I've just started working on this problem so I don't have much work to show. All I want to do is when a user clicks a button, whatever is in the text area is copied over to a word document ready for printing. If could give me some ideas on how to approach this it would be extremely helpful. Thanks in advance
Frys82
- 08-24-2009, 11:08 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You should start with a component that allows formatting in the first place.
java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html should be a good place to start.
- 08-24-2009, 02:08 PM #3
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
Hello, I seem to have solved it. I'm using a action listener on a button and whenever it is pressed it used a PrintWriter to print whatever is in the JEditorPane to a ".doc" file. Thanks anyway
- 08-24-2009, 02:28 PM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Glad you got it working. I hope you have all that in its own separate thread too. You shouldn't be running I/O tasks on the EDT.
- 08-24-2009, 06:27 PM #5
Member
- Join Date
- Aug 2009
- Posts
- 6
- Rep Power
- 0
I think I might be, be it works none the less and you can't argue with results
- 08-24-2009, 08:41 PM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
writing word document using poi hwpf
By devday in forum New To JavaReplies: 4Last Post: 08-07-2011, 11:15 AM -
How to create a table in word document using hwpf
By devday in forum Advanced JavaReplies: 0Last Post: 07-23-2009, 02:41 PM -
Reading Microsoft Word Document in JAVA
By satheeshtech in forum Advanced JavaReplies: 0Last Post: 07-18-2009, 08:21 AM -
copying contents from word document to JTextPane
By success21061985 in forum Advanced JavaReplies: 1Last Post: 11-05-2008, 06:09 AM -
Saving word document from iframe
By anil@netedgecomputing.com in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 05-15-2008, 11:49 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks