StyledDocument Blues

Sep 5, 07:33 PM

I had a idea for a neat little application. It should have been simple since Java has a widget for editing styled text. But I’ve been spinning my wheels dealing with various aspects of the StyledDocument interface and it’s horde of companions. My first clue should have been StyledEditorKit reads and writes plain text by default and the second clue should have been the length of time HTMLDocument takes to load and third clue should have been HTMLEditorKit hasn’t been updated to HTML 4 or XHTML.

I need to store text with formatting, but I need to control which formatting is stored (some formatting is done on the fly). So the default HTML and RTF kits are out the window. I’d like to export to HTML but I don’t want to live there.

The problem is there isn’t much documentation on using custom Documents with these controls or even how Style is used with controls. This guy has more complete rant about these components. I’ll need to a lot more research of this if I’m going to continue or just give up a write a new control.

On the plus side, I’ve almost finished a iTunes-like search control. I just don’t have anything to search yet.

Update:
Christian Kaufhold (referred above as “this guy”) also has information on his site about mapping elements to views.

Commenting is closed for this article.