> After much experimentation, I've got something which can display an HTML
> page and wich lets me modify bold & italic attributes of the text. But
[quoted text clipped - 6 lines]
> have to know what font styles to remove in addition to the tag I'm
> dealing with?
Yes. I think the intent was to make one implied by the other, but there
are gaps where StyleConstants and the corresponding HTML attributes get
out of sync. In those cases, you have to remember to set both
appropriately.
> 2) How do I arrange things to insert (e.g.) bold text when I don't have
> any text selected? In other words, I want to be able to click a
> button to turn boldening on or off at the current insertion point
> so that anything I type at that point is inserted as bold text (or
> not-bold in the middle of some bold text).
See the StyledEditorKit.getInputAttributes method. Storing an attribute
in there will cause it to be used for newly inserted text by the default
insertion actions.
> 3) How do I insert line breaks <br> and paragraph styles (<h1>, <p>,
> <pre> and so on)?
It's not exactly trivial, and it depends on exactly what you plan to
insert.
> If anyone can advise me I'd be very grateful. The documemtation doesn't
> exactly go out of its way to make this clear...
I've done a lot of this work of dealing with quirks in HTMLEditorKit and
its associated classes, and MindIQ is attempting to release it as open-
source code. I don't have the time at the moment, though, to clean it
up and prep it for release, though. If you're interested in helping
with that, it may be easier than reinventing what we've already done.
Contact me offline if you're interested.

Signature
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation