Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #5327

Re: JTextPane.setEditorKit()

From Knute Johnson <nospam@knutejohnson.com>
Newsgroups comp.lang.java.gui
Subject Re: JTextPane.setEditorKit()
Date 2013-04-19 17:00 -0700
Organization A noiseless patient Spider
Message-ID <kksllf$bf9$1@dont-email.me> (permalink)
References <a7fc08ff-4adc-459b-9fae-0b5e948d20a3@googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

JTextPane.setEditorKit() FredK <fred.l.kleinschmidt@gmail.com> - 2013-04-19 13:45 -0700
  Re: JTextPane.setEditorKit() Knute Johnson <nospam@knutejohnson.com> - 2013-04-19 17:00 -0700
  Re: JTextPane.setEditorKit() Roedy Green <see_website@mindprod.com.invalid> - 2013-04-20 07:55 -0700

csiph-web