Article View: borland.public.jbuilder.java.swing
Article #10322JEditorPane
From: Mohan Shenoy
Date: Mon, 18 Oct 1999 00:00
Date: Mon, 18 Oct 1999 00:00
12 lines
1001 bytes
1001 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:
<7uepl2$l628@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,f5d739f72075e11a,start X-Google-Attributes: gid111d45,public From: "Mohan Shenoy" <shenoym@vsnl.com> Subject: JEditorPane Date: 1999/10/18 Message-ID: <7uepl2$l628@forums.borland.com> X-Deja-AN: 537431814 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