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 / General / November 2007

Tip: Looking for answers? Try searching our database.

Adding bookmark in JEditorPane

Thread view: 
manu - 21 Nov 2007 09:47 GMT
Hi Friends,
I am displaying an HTML file's contents in a JEditorPane. I want that,
whenever that file is opened, the cursor should be on a particular
position. How it can be done?? Pls tell ASAP.

Thanks in advance
Andrew Thompson - 21 Nov 2007 10:45 GMT
...
>...Pls tell ASAP.

If you don't get an answer within half an hour, it's 'free'.

Signature

Andrew Thompson
http://www.physci.org/

Manish Pandit - 21 Nov 2007 18:55 GMT
> Hi Friends,
> I am displaying an HTML file's contents in a JEditorPane. I want that,
> whenever that file is opened, the cursor should be on a particular
> position. How it can be done?? Pls tell ASAP.
>
> Thanks in advance

Here is the javadoc:

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/JTextComponent.html#set
CaretPosition(int
)

The method is setCaretPosition( ). However, be careful to give it a
value between zero and the size of the text.

-cheers,
Manish
Roedy Green - 21 Nov 2007 23:15 GMT
On Wed, 21 Nov 2007 01:47:38 -0800 (PST), manu
<manu.maheshwari@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>I am displaying an HTML file's contents in a JEditorPane. I want that,
>whenever that file is opened, the cursor should be on a particular
>position. How it can be done?? Pls tell ASAP.

Here are two hints.

1. When you can't find the method you want in the class, look in the
superclasses.

2. the "cursor" is the thing that tracks the mouse. The "caret" in the
thing that tracks the insertion point in a block of text.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Roedy Green - 21 Nov 2007 23:25 GMT
On Wed, 21 Nov 2007 01:47:38 -0800 (PST), manu
<manu.maheshwari@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>the cursor should be on a particular
>position.

see http://mindprod.com/jgloss/cursor.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



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.