permaculture playing cards*
The moose likes Swing / AWT / SWT and the fly likes Text Editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Text Editor" Watch "Text Editor" New topic
Author

Text Editor

matt beedle
Greenhorn

Joined: Sep 06, 2004
Posts: 1
Hi,

I'm trying to write a small program which converts between text and html. The user edits the text in a JTextPane, selects bits of it and presses bold, italic buttons etc to format it. This works fine, but I want to convert the formatting to html tags when a button is pressed and I can't find any simple tutorials.
I would like to search through the text a character at a time, and if for example, a character was bold, insert a <b> tag when a plain character is reached, insert a </b> tag.

Can anyone help please!

Matt
kelly devon
Ranch Hand

Joined: Apr 15, 2004
Posts: 75
here it may not help much but u should go thru the tutorials carefully
there should be solutions read between the lines. thats all i can do hope it helps


kel
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Text Editor
 
Similar Threads
How to handle nested html tags in XSL?
Why is Swing text always bold?
HTML Chars escape
JEditorPane nbsp handling error ?
converting String into html