On 4/19/2013 1:45 PM, FredK wrote:
> Calling setEditorKit()from a JTextPane deletes the current content. I
> did not find this documented anywhere - should it do this?
>
I don't think that is unexpected.
public void setEditorKit(EditorKit kit)
Sets the currently installed kit for handling content. This is the bound
property that establishes the content type of the editor. Any old kit is
first deinstalled, then if kit is non-null, the new kit is installed,
and a default document created for it. A PropertyChange event
("editorKit") is always fired when setEditorKit is called.
NOTE: This has the side effect of changing the model, because the
EditorKit is the source of how a particular type of content is modeled.
This method will cause setDocument to be called on behalf of the caller
to ensure integrity of the internal state.
Parameters:
kit - the desired editor behavior
See Also:
getEditorKit()
--
Knute Johnson