Hi,
I want to write a Java applet wysiwyg text editor which understands a
simple markup language similar to Restructured Text.
I'm not a particularly experienced Java programmer and I'm new to Swing
so I may be wrong, but I think a good approach would be to use a Swing
JEditorPane with a custom EditorKit and Document.
I've written a barebones test application in which my custom EditorKit
and Document classes extend DefaultEditorKit and DefaultStyledDocument
respectively. This gives me a working editor however, I was expecting
to be able to insert styled text into my Document but I'm seeing text
with the default style in the display.
To add styled text I'm doing something like this -
document.insertString(document.getLength(), "This text should be big",
getStyle("bigtext"));
where 'getStyle' retrieves a SimpleAttributeSet from a Hashtable.
I'd really appreciate it if anybody could point me in the direction of
some example code or suggest an alternative methodology if I'm going
about this the wrong way.
Greg Hamilton
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing