Article View: borland.public.jbuilder.java.swing
Article #9235Working with StyledDocument
From: Jean-Fran�ois Leroux
Date: Mon, 01 May 2000 00:00
Date: Mon, 01 May 2000 00:00
29 lines
1574 bytes
1574 bytes
Hi, I searched the web for hours but found very little information about this subject. To be more specific, here's what I'm looking for : -- I want to create a StyledDocument featuring a kind of TOC - I mean a title, with nodes and leaves under nodes. I read in Swing tutorial at Sun site that it was possible with this interface. For example, I'd like to get a "title" with three "chapters", with "pages" under each chapter, etc. -- Here are the questions : 1� -- When I use DefaultStyledDocument.createRootElement (..) and createBranchElement(..) these elements are initialized at 0,1. How can I put some text inside ? If I use the insert(..) method, I can only work with chars or chars[] , which is not correct (for a full paragraph, even less for a page or a chapter). -- On the other hand, when I use insertString(..), the text is not set within this structure... 2� -- Could you give a pointer towards some example or code sample somewhere on the web ? That would help a lot ! Best regards. -- jfleroux@club-internet.fr
Technical Details
Message-ID:
<8ekqth$99r8@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,767c5bfe4d48fffc,start X-Google-Attributes: gid111d45,public From: "Jean-Fran�ois Leroux" <jfleroux@club-internet.fr> Subject: Working with StyledDocument Date: 2000/05/01 Message-ID: <8ekqth$99r8@bornews.borland.com> X-Deja-AN: 618004336 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing