Statusbar displaying current line number?

Hi,
I am building a swing application where I have one text editor and one status bar. I want to display current line no in status bar. I tried with getCaretPosition() but it does not returns line number, is there any other way to get current line number to display it on status bar? Thanks.

is there any other way to get current line number Did you search the forum?
How about the keywords "current line number", taken directly from your question. So you can see its really not that hard to think of keywords to use in a search.

Similar Messages

  • Current line number in smartform

    Hi All,
              I need to know is there anyway that i can know the current line number in smartforms.
    My requirement is:
       I have 1 header item and its 3 line items, if there is no space in main area to display all the header and its line items , then it sould be printed in next page,
    Eg:                          PAGE 1
    HD       Line
    A           01
                 02
                 03
    B           01
                 02
                 03                       PAGE 2.
              if this is the case then whole B 01-03 should be printed in next page.

    Hi,
    Please search SDN for Page Protection in Smartform Table
    You will get lot of info.
    Regards,
    Vishal
    Edited by: Vishal Jadhav on Nov 5, 2008 12:36 PM

  • How to find dynamically the current line number in the source file

    Is there a mechanism like __LINE__ and __FILE__ macro in C to get dynamically
    the current line number and file name of a source file?

    Don't know - but others have asked too. Have you searched the forum? For example:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=210496

  • How to read current line number in function module sourrce code?

    Hi All,
    How to read current line number in function module sourrce code?
    regards,
    Anuj

    If you have new editor you would be able to see the line number. 
    Or in the Dump screen - there is a button called Debugger - click that you would be able to see the code where dump has occured..  you would be able to find the line number from there.
    To get the new editor with line number , you need to change the settingsin SE38.
    Regards
    Vivek

  • 2.1 EA2: is it possible to pass current line number to external tool

    When I define external tools (in Tools / External Tools...) I can pass current file name and directory to my external program.
    Is it also possible to pass current line number (where is my cursor in open file) to external program as a parameter?
    If not then it would be a feature request from me :)
    And also - is it possible to develop SQL Developer extensions for syntax color coding of other file types (meaning other than PL/SQL files)?

    raymonds,
    For line numbers, we cannot do it at the moment as it is not exposed in that API, however, you can request it on http://sqldeveloper.oracle.com at the feature request station
    For color coding for another language, you can develop a hilighting plugin, but we do not have an easy way of associating the plugin with an editor for a specific file type. Again this would be a feature request.
    Remember, all these get evaluated each month and assigned into Enhancements for the tool. If enough folks vote for the feature, it is highly likely it will appear.
    Barry

  • SapScript, How do I read the current line number?

    I have sections of text - each in it's own element with an 'include' of the standard text.
    These sections are variable in size.
    All elements are in the MAIN window.
    I do not want a paragraph to split over two pages.
    How do I read the current line number within the sapscript before the section prints so I can issue a new-page command at the beginning of the paragraph?
    Thanks!

    Yes, that does work for paragraphs.
    If I have multiple elements to print from within a loop where "at first, at each and at last" each call the Sapscript funtcion write_form - how can I keep the whole section together.  protect/endprotect will keep each element together but not the group of elements.
    There must be a way to find the current line number.

  • Why jdb can't display the line number?

    Hi,
    I use jdb to debug HelloWorld.java run on cldc_hi. Where cldc_hi is build ENABLE_JAVA_DEBUGGER=true
    I compile HelloWorld.java with -g
    And use the same java version when compile and launch
    In jdb I input
    stop in HelloWorld.main
    run
    step ...
    jdb shows�F
    Step completed: Thread1[1] thread="Thread1", java.lang.Class.initialize(), line=-1, bci=180
    what cause line gives -1 ?
    Thanks very much for any suggestions
    gan

    I would suggest trying the debugger in eclipse.
    This displays each line graphically.

  • Updating the Line number on status bar.

    Hi all,
    I have developed an editor using swing, however I have used the JTextpane class to display the text. I had did of trouble with features such as go to line as this class does not support methods such as getLineCount in the JTextArea class. However I over came this by writing the method shown below.
    The problem is that I want to show the current line number on the status bar. When do I call this method? After every '\n'?
    The setLine Number method is below.
    Thanks for your help
    Ciara
    public void setLineNumber(int num) {
    int lineNum = 1;
    int lastNewline = 0;
    char text[] = editor.getText().toCharArray();
    if (num < 1)
    return;
    if (num == 1) {
    editor.setCaretPosition(0);
    return;
    int i;
    for (i = 0; i < text.length; i++) {
         if (text[i] == '\n') {
         lastNewline = i;
         lineNum++;
         if (num == lineNum) {
         editor.requestFocus();
         editor.setCaretPosition(lastNewline + 1);
         return;
    }     

    Perhaps extending a PlainDocument is better, if line
    numbers are meaningful for your application.
    About your method, mind that getText can be quite dear,
    so it is better not to call it if you don't need it.
    For a more efficient alternative, look at Document.getText(int offset, int length, Segment txt)It uses a Segment (un unguarded string) pointing directly
    into the document, which you can use much like a char
    array.
    As to your question, I would define a CaretListener
    so as to update the status bar when the caret moves.

  • Re: Method name and/or line number available from withinForte?

    To my knowledge there is no such capability with forte, and for sure it
    would be nice. Short
    of storing all that metadata at runtime, a compile-time substitution such
    as is done with
    most C preprocessors would work as well.
    However, I believe the solution you've identified falls short in a deployed
    fashion - I think
    all that method name/line number stuff is only available from the workshop...
    -J
    At 02:54 PM 10/27/98 -0600, [email protected] wrote:
    I'm sure this question has been asked many times, but I don't know that I've
    ever heard the answer. Is there any way from Forte to access the method
    name of the currently executing method? What about the current line number?
    I'm sure you all know what I'm getting at by now -- when raising your own
    custom exceptions or logging messages we'd like to be able to not hard-code
    method names and line numbers into them. I know these are available with
    log flags so this information is stored somewhere -- is there an API to
    access it on an agent, the task, or the environment? The only way I can
    think of doing this (which is not-so-elegant) is to force a Forte exception
    to be raised (like access a method on a null TextData or something), then
    immediately catch it and extract the method and line number from it. Is
    there a more elegant way?
    -J.C.
    J.C. Hamlin, Senior Consultant, Forte National Practice
    Born Information Services Group, Wayzata, MN
    Ph: (612) 404-4000 Ph2: (612) 783-8270 FAX: (612) 404-4441
    <[email protected]> <[email protected]>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>**************************************
    John L. Jamison
    Vice President and Chief Technology Officer
    Sage IT Partners, Inc.
    415 392 7243 x 306
    [email protected]
    The Leaders in Internet Enabled Business Change
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Method task.TraceBack () returns a string suitable for shoving on the error
    stack, and representing a call trace. The method
    method TomW_RaiseException.RaiseException
    begin
    ge : GenericException = New ();
    ge.SetWithParams (SP_ER_USER, task.TraceBack ());
    task.ErrorMgr.AddError (ge);
    Raise ge;
    end method;
    produces the following when called from the display method of the window in
    which it is embedded.
    USER ERROR:
    Traceback:
    TomW_RaiseException.RaiseException at line 2
    TomW_RaiseException.Display at line 4
    TomW_RaiseException. at offset 13
    C++ Method(s)
    UserApp.Run at offset 96
    Class: qqsp_Exception
    Last TOOL statement: method TomW_RaiseException.RaiseException, line 3
    Error Time: Wed Oct 28 08:28:34
    Exception occurred (locally) on partition "TomW_Test_CL0_Client",
    (partitionId = AA6475E0-3DD2-11D2-B582-04228BFFAA77:0x117f:0x6,
    taskId =
    [AA6475E0-3DD2-11D2-B582-04228BFFAA77:0x117f:0x6.34]) in application
    "FTLaunch_cl0", pid 195 on node SPNMXSHOP7 in environment SFDEVL.
    I suppose that a sufficiently determined person could parse the results of
    TraceBack () and extract the
    method and line from it. But I know of no method that explicitly returns
    the name of the calling method.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • How to get line number in JAVA code?

    Hi,
    What method can I use to return the current line number of my coding?
    Assuming I'm at line 10 and I want to do something like System.out.println("I am at line number " + ????);What method should I use to get "10"?
    Please advise.
    Thank you.

    If you run Java in Dos prompt, a new line of result is displayed at bottom and the screen scroll. There is no line number in that way. Other language like C have something like that.
    If you use Java Swing, you can display with x, y coordinate option but it is graphic mode.

  • JEditorPane - getting Selected Text or Active Line number

    Is there any predefined method that will give me the current line selected or the line at which the cursor is?
    I am displayed a piece of java code in my JEditorPane, the user can browse through the entire file.. and I need to call an event when a user selects/double clicks a particular module name or based on the current line number where the cursor is. Is there any simple technique to get the line number or the current highlighted text?
    I am relatively new to JEditorPane. Also If you think I shoudl go upon writing an actionListener, a mouse of keyboard... please let me know how to go about it. I keep getting confused.
    Thanks,
    Sirish

    In the future, Swing related questions should be posted in the Swing forum.
    there any simple technique to get the line number Well, a JEditorPane is typically used for displaying HTML. So does a line number make sense when you don't know the contents of the HTML. If you simply have lines of text then you should be using a JTextArea or a JTextPane.
    Check out this posting for a method to return the line number at a give caret postion:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=608220
    or the current highlighted text?Read the API. A get??? method will do what you want.

  • How to get input source line number

    I wrote a XSLT transformation that checks the input XML for errors.
    When the transformer finds a problem, it can terminate with <xsl:message terminate="yes">, which outputs the line number within the transformer XML source. I do so in my implementation to indicate errors.
    But i need to output the line number of the input source, not that of the transformer source, because this is the location of the error.
    Anybody knows how to do this?
    How can i get the current line number of the input source XML text?

    Hello Fritz!
    XALAN reads the entire input file (SAX) before starting with transformation.
    So overriding the input stream is no way to find this line number.
    I think this would have to be a built-in XSLT functionality within the tag "xsl:message".

  • Line number in a stored procedure

    Hello All,
    In a stored procedure, as a part of logging the debugging information, I want to store the current line number in a variable (say line_number) and return it from the stored procedure as a output paramater. I would like to update line_number with the current line number in the stored procedure code at certain intervals. This would help me to know till where the procedure executed in case of failure.
    Now my question is as follows:
    Is there any standard variable in Oracle which gives the current line number in the stored procedure?
    Please see the example code below
    CREATE OR REPLACE PROCEDURE XXXXX
    (line_number OUT NUMBER)
    AS
    line_number = <current line number in the code>
    line_number = <current line number in the code>
    line_number = <current line number in the code>
    EXCEPTION
    WHEN OTHERS THEN
    BEGIN
    ROLLBACK;
    END;
    END XXXXX;
    Best Regards,
    Ramesh

    Hi,
    No, is not. Try to use all_source for this.

  • Line number in Classical Report

    Hi All,
    How to get current line number in Classical Report?
    i want to show that in my o/p.
    regards,
    Anuj

    Hi Anuj
    Please try like this
    there are 2 ways.
    READ CURRENT LINE FIELD VALUE <fieldname>.
    READ CURRENT LINE.
    first statement does'nt work on numeric type fields especially when there are commas ',' like 5,600,00.
    it'll give you dump.
    but always works on CHAR type.
    so in your case use second statement. though you're reading entire row but use only single field what ever you want.
    check this example.
    DATA : BEGIN OF itab OCCURS 0,
    matnr LIKE eban-matnr,
    menge LIKE eban-menge,
    END OF itab.
    AT LINE-SELECTION.
    READ CURRENT LINE.
    WRITE :/ itab-menge.
    START-OF-SELECTION.
    SELECT matnr menge INTO TABLE itab FROM eban UP TO
    10 ROWS WHERE matnr NE space.
    LOOP AT itab.
    WRITE :/ itab-matnr, itab-menge.
    HIDE : itab-matnr, itab-menge.
    ENDLOOP.
    Thanks
    venkat

  • Display  Purchase order, PO Item , Order Number ,entry sheet quantity ,entry sheet price ,invoice quantity, invoice price  against each line number

    hello all,
    i have an ALV report requirement like this,
    on the initial screen i have displayed(for a given agreement number like in ME33K )
    in the selection screen i have taken agreement number as EKPO-EBELN.
    purchase document number        item number        short text        target quantity      net price
    5400000019                                  1                      xxx                  1.000                  304300.00
                                                        2                     xxxx                 1.000                  500000.00
    the above fields i have taken from EKPO table.....
    and on double clicking the  item number i have displayed
    line number          service number       short text           quantity    units    gross price   quantity released
    1                           swr10                   xxxx                 2.00          kg          500             2
    2                           swr11                    xxxx                5.00          EA         500             2
    the above fields i have taken from ESLL (esll-extrow, esll-srvpos, esll-ktext1 , esll-menge  etc......)
    this i have done by passing EBELN to ESLH and getting PACKNO and passed this PACKNO to ESLL.
    now my question is i need to display  Purchase order, PO Item , Order Number ,entry sheet quantity ,entry sheet price ,invoice quantity, invoice price
    against each line number above.....
    from which table do i need to take these fields.....
    please guide me....
    thankq....

    Thanks Andra,
    The problem is the multiple invoices is for non goods receipt item so there will be no delivery.At the time of creating a PO the GR is not checked so there will be no delivery .
    Also this setting is for invoices which are comming from Vendors.But if we are genrating the invoices manually it is not blocking those invoices.Also i there is nowhere mentioned in Incomming invoice to set tolerence for incomming invoice.Are you talking about Vendor tolerences?
    Thanks in advance
    Edited by: Metroid01 on May 14, 2009 6:52 PM

Maybe you are looking for

  • Query in SQL Server 2005 Where in 2 column

    Good day!! to all im kinda stuck in here... here is the senario i have a table violation with column of ID (primary key) DateCommitted (Date Time) TimeCommitted (Date Time) ViolationComitted (varchar(250)) im not the one who created the table im kind

  • How do I modify the template used in the Photo Gallery module

    I notice the Photo Galleries are rendered as an HTML table and I would like to make a small modification to the way the gallery is rendered on the page. Basically I just want to wrap a DIV around the <img> tag so I can control the look of the image v

  • Can't drag items from desktop to Captivate 6.1 64bit

    I updated from Captivate 6.0.1 to 6.1 (both 64 bit) and can no longer drag items from the desktop or Adobe Bridge to a Captivate project.  I reinstalled 6.0.1 and could.  Again updated to 6.1 and again could not.  The Import to library button and the

  • Multivalue parameter values

    @partno is defined a multivalue parameter when I enter a single part number or leave it empty data is properly returned. when I enter multiple part numbers data is not returned.  I have tried:  604-02394, 604-03492 in the parameter prompt. I have tri

  • Need to Export Emails to Single CSV file

    Is there an Apple Script that can accomplish the following: I have form emails from my clients that I want to consolidate into 1 CSV file. Is there a way to accomplish this?