How can we get the selected line number from JTextArea ?

how can we get the selected line number from JTextArea ? and want to insert line/string given line number into JTextArea??? is it possible ?

Praitheesh wrote:
how can we get the selected line number from JTextArea ?
textArea.getLineOfOffset(textArea.getCaretPosition());
and want to insert line/string given line number into JTextArea??? is it possible ?
int lineToInsertAt = 5; // Whatever you want.
int offs = textArea.getLineStartOffset(lineToInsertAt);
textArea.insert("Text to insert", offs);

Similar Messages

  • I have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    i have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.  Use your backup copy to put everything back.
    If you have failed to bakup, then you can transfer itunes purchases from an ipod: File>Transfer Purchases

  • How can I get the built in apps from iPad 2 to my iPad 1?

    How can I get the built in apps from ipad2 to my iPad 1?

    Is your iPad 2 running iOS 5.0.1 and your ipad 1 running iOS 4? If this is the case then go through the update process on your iPad 1. All the iPad 2 apps running on iOS 5 that are compatible with the iPad 1 will be put on your iPad 1. Those apps that require a camera will not appear because the iPad 1 does not have a camera.

  • How can I get the selected rows from two ALV grids at the same time?

    I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
    The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
    It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
    As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
    How can I select the rows, then click on just one button, and process the marked entries from both grids?
    Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
    Thanks.

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

  • How can i get the selected portal theme

    Hi all,
    it is possible to get the current used portal theme.
    I need the path to the css file of the current selected theme.
    I've tried to get the css file over the pageContext like:
      pc.getStylesheetUrl()
    But the result of this methode is: /htmlb/mimes/ur/ur_ie6.css
    I'm loking for an url like:
    /irj/portalapps/com.sap.portal.design.portaldesigndata/themes/portal/sap_standard/ur/ur_fc_ie6.css
    Torsten

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

  • How can i get the music ive copied from cd onto my new computer

       how can i get the music that i have copied from cd's on to my new computer.(the computer my phone was sync to blew up)  if i sync to the newit i will all the music  thats on my phone, 

    Restore from the backup of your old computer. Copy it from the CDs.
    Look for a 3rd party app that can do what you want. Senuti has been
    mentioned in the past - I do not use it so cannot comment on how
    well it works. I would assume there are others as well.
    iOS does not natively support syncing music back from the iPhone
    to a computer.

  • How can i get the selected PageItem in InDesign

    Hi
    i received the hint to post the message into this forum. so i try it...
    After implementing a floating panel and receiveing the "afterSelectionChanged"-Event i would like to get the selected PageItem, if one is selected...
    In the datastructure i can only find the activeLayer (event.target.activeLayer)  and the activePage (event.target.activeLayer), but no activePageItem or so.
    Is there a possibility to get this PageItem?
    best thanks for any hint.
    Lorenzo

    Lorenzo,
    This is the SDK forum. David sent you to the scripting forum: http://forums.adobe.com/community/indesign/indesign_scripting
    But I already answered on the CS SDK forum http://forums.adobe.com/message/3915745#3915745
    Harbs

  • How can I get the username and password from Oracle Forms to PJC !

    Dear Sir,
    I have username,password and push button fields in oracle forms. When user clicks the push button, I need to get username and password field contents to my Pluggable Java Program to authenticate the user trying to login. How can I get those text field contents to my java program..? Looking forward from you soon sir.
    Thanks in Advance,
    S Ramkumar

    I tried that trigger but nothing reflects. I write that method in WHEN_BUTTON_PRESSED trigger.
    In the form module I written,
    Set_Custom_Property('BL.USERNAME',1,'NAME','');
    Set_Custom_Property('BL.PASSWORD',1,'PASS','');
    Implementation class of the push button I gave my java class file name.
    In Java Code I tried register the form fields like,
    public static final ID userName = ID.registerProperty("NAME");
    public static final ID passWord = ID.registerProperty("PASS");
    In Java Code I tried get the contents from registered properties,
    public boolean setProperty(ID property, Object value) {
    if(property == userName) {
    System.out.println("Just I wish to see the name entered" + value.toString());
    if(property == passWord) {
    System.out.println("Just I wish to see the pass entered" + value.toString());
    But even System.out.println() is working.
    What's wrong with this code sir ???
    Can you tell me How to register and get those field values in Java ?

  • I somehow lost a large amount of my music downloads and albums that I had uploaded to iTunes.  How can I get the items I downloaded from iTunes Store again?

    I upgraded my Anti-Virus and it included a storage box which I tried to use but it filled up with my iTunes music so I deleted that but evidently it also removed a lot of my music from my iTunes libraries.  I can re-upload all the music from CDs but how do I replace the music I bought from the iTunes Store?  I really don't want to buy the music again, in fact I just can't do that.  Any suggestions?

    LindyLouToo wrote:
    ...  how do I replace the music I bought from the iTunes Store? 
    Download Past Purchases
    Sign in with the Apple ID that you used for the original purchase. See which Apple ID you used to download an item.
    2 )See if the content is available for redownload. Previously purchased items might not be available if they're no longer on the iTunes Store

  • How can I get the sales document number in CRM??

    Hello,everybody
    I want to create a document flow report in CRM.
    But I donnot know how to get the documen id which is in ERP (for example: Sales, Billing)
    Is there anyone who can give me some advice?
    Thanks.

    Do you have ERP documents in CRM ? I mean does ERP documents are getting replicated in CRM? or you want transaction no from ERP only ? Which version are you working on?
    Thanks,
    Nitin

  • How can I get the selected action of content type by javascript from Firefox Options Applications?

    I works on my website, and it have to check the PDF file will be opened in which plugins
    So we have to implement some javascript to check the selected action of Content Type from Tool>Options>Application
    Do we have any javascript code to check this

    You can't check this with code that runs on the server or via JavaScript in the web page.
    Note that current Firefox version do not expose the built-in PDF Reader via the navigator.plugin array, so if you can't detect a plugin than maybe assume that the built-in PDF reader is used with Firefox version 19 and later.
    *Bug 840439 - Expose PDF.JS as a plugin navigator.plugins when enabled

  • How can I get the selected row's index of a Jlist wrapped with JScrollpane?

    the problem is that I can use getSelectedIndex() only if the JList is not wrapped in a JScrollPane.
    but in my program the JList IS wrapped in a JScrollPane.
    when I select one item of the jscrollpane I can't catch the event.
    please F1 me.
    Lior.

    What difference does it make if the list is inside a scroll pane or not? If you have a member varialbe that references the list you can call getSelectedIndex when ever you need.
        myList = new JList (...)
        someComponent.add (new JScrollPane (myList));
        //  Then later
        int sel = myList.getSelectedIndex ();And you can always be up on any selection chagnes in the list by supplying it with a ListSelecitonListener.

  • How can i get the ipad serial number if it stolen

    My IPad was stolen in turkey and i cant locate it on iCloud.... I just need the serial number so I can report for the police
    thanks in advance

    Sign into your Support Profile. It should be there.
    https://supportprofile.apple.com/

  • How can i get the reference to Controls from VI-reference

    Hello,
    i have a VI with ~5 controls on it.
    And with the Object "Current VIs path" and "Open VI reference" i can create a reference to the current VI.
    How can i create now a reference to the controls? (Starting with VI-reference?
    Of course i know how to create directly a reference from a control.
    My idea wasm that there areperhaps properties like:
    - Number of controls
    - Name of control
    - Type of control (string, bool. number...)
    Is this somewhere there and i just dont find it?
    Thanks for your help

    Once you have the VI Refnum, it's a two-step process. Wire the VI Refnum into a property node and get a reference to the Front Panel. Output the Front Panel reference into another property node and select the property Controls[ ], which outputs an array of references for all the controls on the front panel.
    Message Edited by Jarrod S. on 04-20-2007 11:06 AM
    Jarrod S.
    National Instruments
    Attachments:
    get_ref.PNG ‏5 KB

  • How can I get the last 18 numbers from this string

    Hi,
    I'm querying this field from a table. How can I only get the last 18 numbers:
    The numbers look like this:
    500000000818118

    If it is always the last 18 numbers just use the Right() function.  Examples:
    Right("500000000818118", 18)
    or
    <cfset mystring = "500000000818118">
    <cfset mynewstring = Right(mystring, 18)>
    or
    #Right(yourquerycolumn, 18)#
    etc.
    Edit:
    Well I just noticed that your example string is only 15 characters long.  Perhaps I mis-understood your question?
    Message was edited by: Miguel-F

Maybe you are looking for

  • Reading a video input using a java application

    I want to read a live video input inside a java application and extract frames from that video,..But I don't have knowledge of doing this. If any of you know how to implement this would you please send me some sample applications codes to one of the

  • Site Manager menu option are not there

    Hi guys! I'm quite new with business catalyst, but I've recently become a paid account (Webcommerce) and I have 2 options below the menu tab "Site Manager". I'm watching a lot of tutorials and all of them got a lot op options below the site manager,

  • How to stop my screen from flashing

    How do I get my 2nd gen I Touch screen from flashing?

  • Shortdump when creating new Application set

    Hi All, We have a newly installed BPC system (BPC 7.0, SP 02). We are facing issues when creating new Application Set. Although on the .Net server it shows that the creation of appset was successful, in SM37 Copy AppSet job is terminated with Shortdu

  • CF9 - cfinvoke seems to search scopes in different order

    We came across this in a legacy app when it was moved to CF9 -- a cfinvoke that had always worked in previous versions seemed to stop working whereas invoking the same method using function notation returned the right results. I've only tested the fo