🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9979

Re: JTextPane.insertComponent()

#9979
From: Zippy
Date: Sun, 05 Dec 1999 00:00
29 lines
1820 bytes
use the StyleConstanstants.getComponent(AttributeSet). I assume that
you are already able to find the element containing the object..
>
>I'm writing a custom JTextPane that allows the user to embed a component
>from a list, (specifically JLabel's), into the text at the cursor.
>
>I was very happy to find the method JTextPane.insertComponent().
>It works exactaly how I want it too.
>
>However, when the user is done editing the JTextPane I want to be able to go
>through it and seperate the text String's from the Components (JLabel's)
>that have been inserted.
>
>By getting a reference to the Document associated with this JTextPane and
>iterating/traversing through the elements I  have been able to distinguish
>between "content" and "component".  Unfortunately I haven't been able to get
>a reference to on the actual Component object that was embedded.
>
>I've searched through the swing and swing.text packages and I don't know how
>to get this reference to the inserted Component in relation to where it is
>embedded in the text.
>
>Any help would be GREATLY appreciated.
>
>
>Dan Jenkins
>
>
>
Technical Details
Message-ID: <3849efdd.1209329@news.pangea.ca>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8295lo$nka$1@schbbs.mot.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,217e767a1248f462,start
X-Google-Attributes: gid111d45,public
From: Zippy@Pangea.ca (Zippy)
Subject: Re: JTextPane.insertComponent()
Date: 1999/12/05
Message-ID: <3849efdd.1209329@news.pangea.ca>
X-Deja-AN: 556770623
Content-Transfer-Encoding: 7bit
References: <8295lo$nka$1@schbbs.mot.com>
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@pangea.ca
X-Trace: pumpkin.pangea.ca 944370056 21355 207.161.248.63 (5 Dec 1999 05:00:56 GMT)
Organization: Oats
Mime-Version: 1.0
Reply-To: Zippy@Pangea.ca
NNTP-Posting-Date: 5 Dec 1999 05:00:56 GMT
Newsgroups: borland.public.jbuilder.java.swing