wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes paste text from Word into html editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "paste text from Word into html editor" Watch "paste text from Word into html editor" New topic
Author

paste text from Word into html editor

Krsta Jovanovic
Greenhorn

Joined: Feb 03, 2004
Posts: 1
How can I enable pasting in html editor to work with text taken from a Word document?
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
JTextComponent has copy, cut and paste methods. You can call them with ctl X, C and V keys or you can add a popup menue and call them in your program. That would apply to all derived classes such as JTextField and JTextArea. Not sure about the HTML classes, though!


The nice thing about Standards is that there are so many to choose from!
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Welcome to the Ranch Krsta,
In this Tutorial you can see that JEditorPane supports the paste action.
I have been able to paste text from Notepad to a JEditorPane displaying an html file; but it did not work with "text" copied from Word.
[ February 06, 2004: Message edited by: Jose Botella ]

SCJP2. Please Indent your code using UBB Code
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
I have clients who copy from Word to my app's JTextArea ok. Word does use non-UTF-8 characters that show up as little squares, but you could translate them.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: paste text from Word into html editor
 
Similar Threads
JEditorpane adds spaces
Design document
display richtext html entered with tinymce in table
how to copy code
What tool do you use to create HTML files in assignment?