Article View: borland.public.jbuilder.java.swing
Article #10323Problem with JEditorPane
From: Mohan Shenoy
Date: Mon, 18 Oct 1999 00:00
Date: Mon, 18 Oct 1999 00:00
12 lines
1014 bytes
1014 bytes
Hi
I am trying to build an html editor. But even a simple piece of code to set
the selected text to bold does not work. Can anyone tell me what is wrong
with the following code?
MutableAttributeSet attr = new SimpleAttributeSet();
StyleConstants.setBold(attr, true);
int p0 = editorPane.getSelectionStart();
int p1 = editorPane.getSelectionEnd();
StyledDocument doc = getDocument();
doc.setCharacterAttributes(p0, p1 - p0, attr, false);
After executing the above code nothing happens.
Technical Details
Message-ID:
<7ueptc$l607@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,d9c0a3477e8ee682,start X-Google-Attributes: gid111d45,public From: "Mohan Shenoy" <shenoym@vsnl.com> Subject: Problem with JEditorPane Date: 1999/10/18 Message-ID: <7ueptc$l607@forums.borland.com> X-Deja-AN: 537435209 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing