JTextPane (Word processor)

Does any one know how to get caret / cursor position on JTextPane from MouseEvent (MouseDragged) ?
Thanks in advance,
Anom

Hi,
try viewToModel(...)-method - there you pass a Point in view-coordinates - I guess, that is the mouse position you get at this location - and you will get an int value in return. I guess, this int-value represents the offset in the document, which is an equivalent for the caretposition, if you would click at that view-location to set the caret to this position.
Hope this helps
greetings Marsian

Similar Messages

  • How can i do the word processor's page operations in my java word processor

    Hai,
    I am developing a word processor using Java. It�s workspace is JTextPane. In order to give the page view and do page operation I have assigned one JTextPane per page.
    Generaly in a word processor if the cursor completes a page, a new page will be created and the cursor will be fixed in the starting position of the new page.
    I need to do the same thing in my word processor.
    That is I need to restrict the JTextPane(page) in such a way that the cursor has to be always inside the JtextPane. It means that the JTextPane (page) should not increase it�s size whenever the cursor goes out of it�s size. Instead a new JTextPane(page) can be created and the cursor can be fixed in starting position of the new JTextPane.
    Thing is that a text component can be added with or without the JScrollPane. In the first case both the scroll bar and the cursor will appear if it goes out of the text component�s rage. In the second case neither scroll bar nor cursor will appear. So these two will not help me.
    How can I do this in my word processor?
    I will be grateful to you if you send some suggestion.
    With regards,
    K. Saran

    Hi,
    this is not an answer to our question, sorry.
    I'm fairly new to Java but is working on a projec similar to yours. I always use other code to learn how new parts of java works. Haven't been able to find any examples of initializing JTextPanes though. Any chance of you posting some here?
    Would be much appriciated.
    Alternatively: do u know a site where u can find such examples??
    Kind Regards
    Thomas

  • Pages: Is there a way to make lines independent, like a real word processor

    There are so many things that infuriate me about Pages. Save As.. missing, autosave, etc which are NOT like 99% of other apps on the Mac.
    Specifially (today):
    I have a letter in Pages. It’s a standard business letter you have see 1m times.
    After the first line of the address, at the top of the letter, I insert a carriage return and BINGO, the tabs in the middle of the letter are suddenly all messed up.
    Grrrrrr.
    Is there a way to make lines independent in Pages? I have this crazy belief that letters are not Web Pages, not HTML, and that an extra line somewhere should not reformat following lines way down the page.
    Alternately, is there some 3rd party word processor that works like the old Apple Works, with graphics and tables you can recommend?
    Thanks

    William Donelson wrote:
    There are so many things that infuriate me about Pages. Save As.. missing, autosave, etc which are NOT like 99% of other apps on the Mac.
    Save As is still there, hold down the option key as you go to the File menu. This is not Pages, it is Mountain Lion.
    Specifially (today):
    I have a letter in Pages. It’s a standard business letter you have see 1m times.
    After the first line of the address, at the top of the letter, I insert a carriage return and BINGO, the tabs in the middle of the letter are suddenly all messed up.
    Grrrrrr.
    Then you are doing something wrong, probably pounding away at spaces, tabs and returns to position things. Turn on invisibles to see what is going on:
    Menu > View > Show Invisibles
    If you have strings of tabs, spaces and returns that is the problem.
    Is there a way to make lines independent in Pages?
    Yes, hit the return key. Like every other Word Processing program.
    I have this crazy belief that letters are not Web Pages, not HTML, and that an extra line somewhere should not reformat following lines way down the page.
    Alternately, is there some 3rd party word processor that works like the old Apple Works, with graphics and tables you can recommend?
    Time to learn Pages. AppleWorks is dead. Stop pining for it. This is a case of user error and instead of blaming Pages, it would pay to find out what you have done and stop doing that.
    Pages, except for the fancy DTP features, tables and charts works like most other Word Processing apps. Just a case of learning new tricks. My guess is you have other stuff going on.

  • Most full featured word processor? (table editing, google docs) and webdav on the ipad

    Hi All,
    So I have had a frustrating time trying to add rows to a table in a word processing document on Google Docs. Are there any word processors that support this? Quickoffice and Documents to Go do not as of this writing. (May 26th, 2011.) at least not that I can determine.
    Does Office2HD support this feature? Do any of the word processors?
    My current thoughts/what Apple needs to do/
    Currently I am thinking about buying Pages and then using Goodreader to open the file in pages, and then saving the pages document to idisk/webdav and then moving it to google docs from idisk/webdav using Goodreader (though it appears you can use Readdledocs too.)
    According to the makers of Docsportal, if Pages supported Open With, I could Open With Docsportal and it would be uploaded. Alternatively, Docsportal could simply add idisk or webdav support, but I can understand why they are waiting for Apple to get their act together.
    Currently, I have discovered that Quickoffice does support mounting quickoffice as a drive as does goodreader. Docs2Go does not support this feature. This is a nice way to get files in and out. The Mac will support WebDAV for the Mac filesystem as of Lion allowing programs like goodreader or readdledocs to connect to it.
    --Sam

    I viewed the Office2HD Help file and it seems to support table creation.
    http://www.bytesquared.com/products/office/ipad/basic.asp?product=office2pro#ins ert_table
    I will post back once I am able to edit a table.
    Office2HD as mentioned elsewhere in this forum supports Google Docs.
    It does also support WebDAV (mounting as an external drive.) The help file mentions that it now allows you to navigate using the cursor or arrow keys.

  • Looking for a word processor without word wrap, text edit doesn't cut it

    I'm looking for a word processor without word wrap, text edit doesn't work. In text edit, it automatically scoots my text over to the next line but I just want it to keep going with a horizontal scrollbar. Is there a text editor I can download from the app store or can I get textedit to work somehow where it uses a horizontal scroll bar instead of entering text to the next line?

    Hi,
    thought TextWrangler can do it.
    But it seems that the 'no word-wrap' "feature" isn't that much wanted anymore.
    Maybe one of these http://www.macupdate.com/find/mac/text%20editor can do it.
    Regards
    Stefan

  • How do I open MS Office 2000 Word Processor on iMac

    Used to use Microsoft 2000 Word Processor on Dell Laptop.  My iMac is 2 weeks old and documents have successfully been transferred from the Dell to Mac via Maxtor external hard drive.   How can I open the Word Processing documents - NOT to use, but to read. WPS is the extension. There is plenty of discussion on MS Word, but not MS Word Processor

    Just quick view from finder .
    Simply locate folder and file within finder window .
    Right click and choose open with quick view
    Or download
    http://www.neooffice.org/neojava/en/download.php#download
    this handles .wps documents and you can convert them to a more universal extension such as .rtd or .doc

  • I cannot copy and paste from email to word processor in microsoft 7, not Office

    why can I not copy and paste from Yahoo email into Microsoft 7 word processor. I don't have Office. I used to do this all the time using Control C to copy and Control V to paste but recently AT&T installed Firefox and I think that's when the trouble started

    There are a range of different kinds of forms. For example, this site uses very simple controls that don't automatically convert Word's formatting to an online format. The site where you are trying to paste your resume probably works differently.
    What methods have you tried using to paste? Typically one of these will work:
    * Ctrl+v
    * right-click > Paste
    * Edit > Paste (from the menu)
    Some sites offer their own buttons to paste, but for security/privacy reasons, Firefox usually disables those.

  • After opening a picture in Photoshop Elements 12 how can I copy the picture to a word processor docu

    After opening a picture in Photoshop Elements 12, how can I copy this picture to a word processor document?

    Open the photo. Press ctrl+A (command+A on a mac) to select it, then Ctrl+C (command+C) to copy it. Go to your word processing document and press Ctrl+V (command+V) to paste it in. (Note that for the last step the procedure may vary slightly depending on your word processor.)

  • Can't copy text to Microsoft Works 2007 Word Processor.

    I have Windows 7. I never had a problem with my Windows XP. When I try to paste to Word Processor, a window pops up and says The information you copied exceeds the size limit for pasting into Word Processor. Try reducing the size of your selection. I tried that but it still didn't work. HELP!

    Scroll down the following page. Lots of folks with that problem:
    http://support.microsoft.com/search/default.aspx?mode=a&query=The+information+you+copied+exceeds+the+size+limit+for+pasting+into+the+Word+Processor&1033comm=1&ast=25&ast=28&res=20

  • Is there a good but free word processor that's Mac compatible?

    I don't know where else this question would belong so I just put it here. So, my question is: Is thier a free (but decent) word processor that's Mac compatible that I can download off of the internet? I've already used up my free trial of "Pages" that came with my iMac. I'd also like it to be able to save and print off text documents and also be PC compatible as well.

    Hi, you already have Text Edit, I use BEAN//it's pretty good, but you can Google your requirements and there are quite a few "freebies"
    http://www.bean-osx.com/
    ...L

  • Cannot copy and paste to third party word processor.

    Greetings to all, I have Windows 7 Professional 64 bit with latest updates on a W520.This is my personal computer with no network. I can not copy and paste, to third party word processor. I was trying to copy and paste to an external hard drive. The computer knows the drive is there. When I do the response is that I have to contact the administrator. Thank you.

    Hi Ldxrunner2015
    I would like to know what word processor program are you using?
    Is your W520 managed by company (Domain) or personal?
    When the response is contact the administrator, does it prompt you for password or other credentials?
    Have a nice day! 
    Peter
    W520 (4284-A99)
    Does someone’s post help you? Give them kudos as a reward, as they will do better to improve | Mark it as solved if the solution works for you, so it could be reference for others in the future
    =====================================
    Sound Enthusiast and Enhancement (Post comments, share mixes, etc.)
    Dolby Home Theater v4 ; IdeaPad Slate Tablet

  • I used to copy from emails then paste to my word processor, now there is no edit option on firefox. why?

    there isn't an edit option in firefox. therefore i can't copy from email and paste to word processor. why?

    You can find the Copy, Paste, and Cut buttons next to Firefox > Edit (and in its sub menu) and in the regular Edit menu on the menu bar (press F10 if the menu bar is hidden).<br />
    The buttons next to Firefox > Edit are enabled if there is something to do with them, just like with the toolbar buttons.<br />
    You can find the Copy, Paste, and Cut toolbar buttons in the toolbar palette in the Customize window and drag them on a toolbar.<br />
    Press F10 or press and hold the Alt key down to bring up the "Menu Bar" temporarily.

  • What is the best word processor for mac?

    I recently got an old mac and i need a word processor to use for school. It needs to be compatible with microsoft word.

    Free versions that work well with MicroSoft Word are NeoOffice http://www.neooffice.org/neojava/en/index.php and OpenOffice http://porting.openoffice.org/mac/
    Or if you're running Snow Leopard 10.6.6 you have the App Store and can buy Apple's Pages for $20.

  • What is the best word processor for mac?  Closest to office?

    What is the best word processor for mac?  Closest to office?

    Welcome to the Apple Support Communities
    On OS X, you have some good word processors:
    - Microsoft Word for Mac. Included in Office for Mac, it's the best option if you are going to use Word documents with your Mac > http://www.microsoft.com/mac
    - Pages. This iWork app is similar to Microsoft Word because both are word processors. This is a good app, too, that you can get from the Mac App Store > http://www.apple.com/iwork/pages/
    - LibreOffice. This free suite allows you to do everything that you can do with paid suites but with a free one. It's also open-source > http://www.libreoffice.org
    You can read reviews of all of them in the Internet, but I personally prefer Pages. If you want something closest to Microsoft Word for PC, obviously the best option is Microsoft Word for your Mac

  • What is a good word processor app as pages has changed and is now rubbish

    Since some stupid update on pages that has absolutely ruined the entire thing, can anyone give me advise on a good word processor app?

    If you had Pages ’09 v4+ before updating to Pages v5+, then the older, more functional application will be in /Applications/iWork '09. This retains your document compatibility with existing ’09 documents, which no other application on earth can open directly.
    If you are done with Apple's interpretation of word processing, then export your documents to MS Word format, and then you have options. One might be Office for Mac 2011 for native MS Word document compatibility with MS Office users. Or, the free LibreOffice, which was purposely (and actively) developed to be a Microsoft Office replacement solution. It is current with Office 2013 documents.

Maybe you are looking for