Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

jEditorPane and getCaretPosition in HTML frames

Thread view: 
Albert Finchly - 23 Jan 2004 04:06 GMT
Hello. :-)

I've got a problem: when I'm viewing a HTML document that
contains frames via a jEditorPane, the getCaretPosition method
always returns 0.  But if I view a HTML document that doesn't
contain frames, getCaretPosition returns what I would expect
it to.  Is this a bug or am I missing something?  I'm assuming here
that I don't have go hunting through the frames of a document, do
I?  And if that's the case, how?  If it's a bug, then can I somehow
intercept the loading of frames and render them myself as individual
documents?  Hmmm...
Christian Kaufhold - 23 Jan 2004 10:43 GMT
> I've got a problem: when I'm viewing a HTML document that
> contains frames via a jEditorPane, the getCaretPosition method
[quoted text clipped - 5 lines]
> intercept the loading of frames and render them myself as individual
> documents?  Hmmm...

They *are* rendered as individual documents in individual JEditorPane
descendants of the JEditorPane displaying the frameset. Each frame
has its own caret and thus its own caret position.

Christian
Signature

And in short, I was afraid.

Albert Finchly - 23 Jan 2004 13:19 GMT
> > I've got a problem: when I'm viewing a HTML document that
> > contains frames via a jEditorPane, the getCaretPosition method
[quoted text clipped - 9 lines]
> descendants of the JEditorPane displaying the frameset. Each frame
> has its own caret and thus its own caret position.

If that's so, how is it possible to query a caret position from a particular
frame?
Christian Kaufhold - 23 Jan 2004 17:17 GMT
>> > I've got a problem: when I'm viewing a HTML document that
>> > contains frames via a jEditorPane, the getCaretPosition method
[quoted text clipped - 12 lines]
> If that's so, how is it possible to query a caret position from a particular
> frame?

Search for its editor pane: Find the element represent the frame
(AttributeSet.NameAttribute == HTML.Tag.FRAME)
find the corresponding ComponentView, use its getComponent, then
search until you find its JEditorPane.

Christian
Signature

And in short, I was afraid.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.