Closed GoogleCodeExporter closed 8 years ago
I think you already have a good workaround :-)
You should generally set any of the properties BEFORE attaching the kit to the
editorpane (using setContentType). In you example, move the setProperty calls
above the setContentType. This will ensure all latest changed the properties
are used. Not all properties will support being changed dynamically after the
kit is attached to the editor.
I think after you read a file, the document of the editor is destroyed and a
new one is created, so you need to add the document listeners again. This is
not jsyntaxpane issue, but a Java Swing issue.
Original comment by ayman.al...@gmail.com
on 26 Feb 2011 at 5:59
The issue is that I get the instance of the kit by the "preferred method":
editarea.setContentType("text/sql");
// Configure syntax coloring
SqlSyntaxKit kit = (SqlSyntaxKit)editarea.getEditorKit();
...
How can I get it before "setContentType"? You said somewhere that a
second method is to get the class name of the kit by:
JEditorPane.getEditorKitClassNameForContentType("text/sql");
But I don't figure out how this is used; could you provide an example of
how to code this method to get the kit instance?
Original comment by bertran...@gmail.com
on 6 Mar 2011 at 5:15
Original issue reported on code.google.com by
bertran...@gmail.com
on 30 Dec 2010 at 4:12Attachments: