Line numbers for a JTextArea

hi i am making a text editor and i need to have a thin jpanel that goes down the side of my textarea which displays the line number.
does anyone have any idea how i would do this?
the API said something about offsets but i dont really understand it, please someone shed some light on the matter, thanks :)

http://forum.java.sun.com/thread.jspa?threadID=5139976&messageID=9514522#9514522

Similar Messages

  • How to insert line numbers in InDesign CS5

    I am creating a document that needs to have line numbers appear every for every 5 lines of text. Using the list function, I can get a number for every line, but can't find a way to just number line 5, 10, 15, 20, etc.
    All help appreciated,
    Cathy

    Thanks for the prompt reply, Bob, but from what I read in the comments on the script is that it inserts line numbers for every line and has no options for customizing to show numbers for only lines 5, 10, 15, etc. Also, using the list function in InDesign on selected text I can get the same result (including multi page if I select all text) and then convert the auto list numbers to text, which would allow me to remove unwanted numbers and leave just the ones I need (although that would be a painful manual process for a longer document.).
    Am I missing something about the script?
    I must admit that I'm shocked that this isn't a built in capability in InDesign!

  • No line numbers in stack trace from Java Stored Procedure exception

    I have a Java Stored Procedure which can generate an exception. In one database (11.1.0.6) the Java stack trace contains line numbers for my code, but not for the classes loaded by default with the JVM. In another database (same version) the Java stack trace does NOT contain line numbers for my code, but does contain them for some of the classes loaded by default with the JVM!
    Neither of the schemas where I am running the the Java stored procedure has a JAVA$OPTIONS tables as described here:
    http://download.oracle.com/docs/cd/B28359_01/java.111/b31225/chtwo.htm#BABIGFGA
    So the Java should have been compile "-debug" by default in both schemas. I specifically set the debug option to true using:
    exec dbms_java.set_compiler_option('', 'debug', 'true');
    but this had no effect.
    Can anyone explain this behavior or tell me how to always get line number in the Java stack trace?

    Hi,
    Try using java.util.logging package. Using these packages you can configure your logging information to include context down to the class name. Then each log message would be unique enough to know where it came from.
    -Priyanka

  • Problems with line numbers (building via ant).

    We use ant for our builds and are having a problem with getting line numbers into call stacks. When running on linux we do not get the lines for our projects (not all projects have debug option), just (Unknown Source), however we do see line numbers for the tib jars. Eclipse is fine, we can see all line numbers as appropriate.
    I have tried "lines", "lines,source" and "lines,var,source" - all build a different sized jar which suggest something is getting added. However as we see line nums for tib it suggests it's some strange java runtime option. We're using sunjdk 1.5.10 and also jrockit.
    Any ideas/answers most appreciated.
    Many thanks, Declan
    Ant task
    <target name="compile" depends="init">
         <javac target="1.5" destdir="${classes}" debug="on" debuglevel="lines,source">
              <src path="${src}"/>               
              <classpath refid="default.classpath"/>
         </javac>     
         <javac target="1.5" destdir="${classes-test}" debug="on" debuglevel="lines,source">
              <src path="${testsrc}"/>
              <classpath refid="default.classpath"/>
              <classpath location="${classes}"/>
         </javac>
    </target>
    Example output
    java.lang.IllegalArgumentException: Field data is null
    at com.tibco.tibrv.TibrvMsg._addImpl(TibrvMsg.java:1503)
    at com.tibco.tibrv.TibrvMsg.add(TibrvMsg.java:1020)
    at com.lehman.fid.jdt.channel.tibrv.TibrvMessage.putObject(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.buildSubMessage(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.buildSubMessage(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.publishDepth(Unknown Source)
    Cmd line
    VM_OPTS="-Dlogfile=../../log/CmdOrderBook.log"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.password=false"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
    PARAMS="-springcfg orderbook-context.xml -instancename CmdOrderBook"
    exec ${JAVA_HOME}/bin/java -DappInstance=CmdOrderBook -server -Xmx500M -Xms250M -Xincgc ${VM_OPTS} com.lehman.cmd.etrading.orderbook.CommoditiesOrderBook ${PARAMS} >> ../../log/Cm
    dOrderBook.out 2>&1

    We use ant for our builds and are having a problem with getting line numbers into call stacks. When running on linux we do not get the lines for our projects (not all projects have debug option), just (Unknown Source), however we do see line numbers for the tib jars. Eclipse is fine, we can see all line numbers as appropriate.
    I have tried "lines", "lines,source" and "lines,var,source" - all build a different sized jar which suggest something is getting added. However as we see line nums for tib it suggests it's some strange java runtime option. We're using sunjdk 1.5.10 and also jrockit.
    Any ideas/answers most appreciated.
    Many thanks, Declan
    Ant task
    <target name="compile" depends="init">
         <javac target="1.5" destdir="${classes}" debug="on" debuglevel="lines,source">
              <src path="${src}"/>               
              <classpath refid="default.classpath"/>
         </javac>     
         <javac target="1.5" destdir="${classes-test}" debug="on" debuglevel="lines,source">
              <src path="${testsrc}"/>
              <classpath refid="default.classpath"/>
              <classpath location="${classes}"/>
         </javac>
    </target>
    Example output
    java.lang.IllegalArgumentException: Field data is null
    at com.tibco.tibrv.TibrvMsg._addImpl(TibrvMsg.java:1503)
    at com.tibco.tibrv.TibrvMsg.add(TibrvMsg.java:1020)
    at com.lehman.fid.jdt.channel.tibrv.TibrvMessage.putObject(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.buildSubMessage(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.buildSubMessage(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.publishDepth(Unknown Source)
    Cmd line
    VM_OPTS="-Dlogfile=../../log/CmdOrderBook.log"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.password=false"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
    PARAMS="-springcfg orderbook-context.xml -instancename CmdOrderBook"
    exec ${JAVA_HOME}/bin/java -DappInstance=CmdOrderBook -server -Xmx500M -Xms250M -Xincgc ${VM_OPTS} com.lehman.cmd.etrading.orderbook.CommoditiesOrderBook ${PARAMS} >> ../../log/Cm
    dOrderBook.out 2>&1

  • Line numbers

    How do I add line numbers to the lines for each transaction on a journal entry report.
    In column C I want to add the line number for each line that has the same transaction number in column D. Then start a new set of line numbers for the next transaction number.

    Hi,
    According to your description, I actually can't understand your issue clarity, would you like to share us a sample file or some screenshots?
    I assume the scenario: you want to add the line/row numbers automatically when type a new transaction record. If so, we may use Row formula. For example:
    =ROW(A1) returns the number 1.
    To enter specific sequential number codes. To start a numbered list with
    000-001, you enter the formula =TEXT(ROW(A1),"000-000")
    Reference:
    https://support.office.microsoft.com/en-gb/article/Automatically-number-rows-76ce49e3-d8d2-459b-bd85-ee1d3973e6e6?CorrelationId=7c89eb49-83aa-4ba7-b936-4d94e522cc3c&ui=en-US&rs=en-GB&ad=GB
    If I misunderstand something, please feel free let me know.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Showing Line Numbers?

    Hi,
    I write news articles for peer review, and one of the main features that I need to display in my drafts are the line numbers for every line. I've tried to search around the pages help as well as these forums, but I'm not finding a solution as to how to display the line numbers in the document as well as on the printed page. Any help? Thanks...
    -Owen

    Hi OwenStratospherical,
    Welcome to Numbers discussions.
    There isn't any built-in way to have line numbers. One possible suggestion, not elegant, is to create a Text Box to the left of the page then using the number keypad enter line numbers in that Text Box. As I said it isn't elegant but, it does work for me when I need it.
    Yes line numbering would be a nice feature for sure.
    The folks on these forums, discussion boards, are end users as yourself not Apple employees. Accept my suggestion for you to please at the top of your screen to the right of the blue Apple click "Pages" > "Provide Pages Feedback". This makes your request known to the Pages team directly. I've sent many as well.
    Let's hope that the next version of Pages (iWork) will incorporate many of the requested enhancements.
    Thank you in advance for doing that.
    Sincerely,
    RicD

  • Reg. Line Numbering to the whole activeDocument

    Hi All,
    I have gone through most of the sites to put line numbers to the whole activeDocument but I could find only applying the line numbers for first page.
    Anybody please help me out to add line numbers to the entire activeDocument with continuos number?
    Any help is greatly appreciated.
    ~Sathya Rani M

    Hi,
    Thank you for the script. This I have found earlier and this is showing demo.
    I need to add numbers continuosly without any text.
    Please advice.
    ~Sathya Rani M

  • JSP stack trace line numbers?? used to be there?

    I could have swore that JDev RC showed line numbers in JSP
    stack traces?
    Anyway, they'd be great. How can the JIT/ojvm be configured to
    make them available to the actual .jsp line numbers.
    Thanks, curt

    The line numbers are there if you aren't using the jsp include tag:
    <%@ include file="some.jsp" %>
    Since this is a compile time include, I still feel that line numbers should be
    present in the stack trace... Well, I wish they were anyway.
    Thanks, curt Curt:
    This depends on which JVM you are using. For 9.0.2, I believe ojvm does not give line numbers. (I think we are changing to show line numbers for 9.0.3.) If you use hospot ('java -hotspot ...') you should see the line numbers.
    Thanks.
    Sung

  • Is it possible(lines numbering JTextArea)?

    is it possible to have the line numbers on the margin of the JTextArea? what i am looking for is something like what is in JCreator, and CuteHTML.
    sample code is appreciated

    Well two ways I can think of:
    1. Create a custom 'Document' class that inserts line numbers and keeps track of where they should be (in the beginning of each line) as editing is performed.
    This seems more cumber some.
    2. Create a container that is composite of JTextArea on the right, and a panel on the left that contains line numbers. As user scrolls, update the numbers in the panel on the left, making it look like it's part of the JTextArea.
    I am sure there are many more ways to do this.

  • How to print line numbers in NWDS for Java?

    Hi everyone,
    does someone know how to print out program code with line numbers from the Netweaver Developer Studio for Java? This is inevitable for code reviews.
    In Eclipse 3.4 this issue is solved. Is there possibly such a patch for NWDS as well?
    Thanks,
    Maria

    Hi Pascal,
    thanks for the quick reply. The setting you mention displays line numbers on the screen alright, but printing out does not work.
    We use: SAP NetWeaver Developer Studio for SAP NetWeaver 7.1 SP06 PAT0000, Build id: 200807051938.
    I guess it just does not work, because it was fixed only for Eclipse 3.4, and the above NWDS version bases on Eclipse 3.3.
    What do you recommend for code inspections - copy/paste into PSPad or do you know a more comfortable practice?
    Greetings
    Maria

  • Assigning sequential numbers for every lines within a group of records

    The scenario is:
    This set of records with group number, lets say 100(group number) contains 7 lines/records. How to assign line numbers (sequential) for each line within these groups on the fly during the mapping process before inserting these set of rows in the target. I know it is easy to achieve in a procedure, but not sure how to do this in the mapping.
    please advice.
    Thanks,
    Prabha

    Use Rank function
    SQL> select empno,ename,deptno,(rank() over (partition by deptno order by empno)) seqno from emp;
    EMPNO ENAME DEPTNO SEQNO
    7782 CLARK 10 1
    7839 KING 10 2
    7934 MILLER 10 3
    7369 SMITH1 20 1
    7566 JONES 20 2
    7788 SCOTT 20 3
    7876 ADAMS 20 4
    7902 FORD 20 5
    7499 ALLEN 30 1
    7521 WARD 30 2
    7654 MARTIN 30 3
    7698 BLAKE 30 4
    7844 TURNER 30 5
    7900 JAMES 30 6
    1111 Test 40 1
    1222 test 1
    1333 2
    17 rows selected

  • Matrix - Help with setting 1st column for line numbers

    Hi,
    I have created a matrix on a custom form and would like to add line numbers to the # column line that of the quotation screen.
    The matrix itself is populated correct from the Query and LoadFromDataSource, and all the fields and columns are filled in correctly, the only column I am having trouble with is the 1st one for line numbers. My code for adding the line numbers is
    SBO_Application.MessageBox("Matrix Count: " & tMatrix.RowCount)
    For i = 1 To tMatrix.RowCount
          oEditText = tColumns.Item("#").Cells.Item(i).Specific
          oEditText.Value = i
    Next
    For the example I am using I get the message box appear:
    Matrix Count: 26
    So I know I should have the line number go from 1 to 26, however I only get 1 to 9 displayed, all the remaining lines are blank.
    Any ideas on why it stops at 9 or what I should do to correctly set the line numbers in the Number column like that of the system Quotation/Sales orders forms.
    Your help is much appreciated
    Matthew

    Hi,
    I tried changing it to the following as you suggested:
    SBO_Application.MessageBox("Matrix Count: " & tMatrix.VisualRowCount)
    For i = 1 To tMatrix.VisualRowCount
        oEditText = tColumns.Item("#").Cells.Item(i).Specific
        oEditText.Value = i
    Next
    The message box still displays 26, however my lines still only go up to number 9.
    Thanks for the quick response.

  • I am facing problem regarding graphical user interface. I am using text box for editing files. I want to show the line numbers and graphical breakpoint​s along with text box. Can anybody help me in this? Thanks.

    I am facing problem regarding graphical user interface. I am using text box for editing files. I want to show the line numbers and graphical breakpoints along with text box. Can anybody help me in this? Thanks.

    Thanks for you reply.
    But actually I don't want to show the \ (backslashes) to the user in my text box. 
    Ok let me elaborate this problem little more. 
    I want to show my text box as it is in normal editors e.g. In Matlab editor. There is a text box and on left side the gray bar shows the line numbers corresponding to the text. Further more i want that the user should be able to click on any line number to mark specific line as breakpoint (red circle or any graphical indication for mark). 
    Regards,
    Waqas Ahmad

  • Line numbering and Item numbering in SRM 7 for shopping carts.

    Hi,
    We are on SRM 7.1.
    The issue we are facing is when a shopping cart has multiple service
    items and one of the service lines is deleted and the cart is ordered
    the item numbering for the shopping cart lines is different in the item
    overview screen in shopping cart transaction as well as sourcing and
    workload reassignment.
    For example,
    - If you create an Item for your SC. This would be Item 1 - line 1.
    - You now create another Item for your SC. This would be Item 2 - line
    2.
    - Then, you add a new line item, which is Item 3 - line 3.
    - Now you delete the second Item (line 2)
    Since we do not show the deleted items, you will only see 2 items,
    however there are 3 lines in buffer.
    - After you save the cart, front end will display two items, which
    have line number 1 and 2.
    - However, item number will be stored as number 1 and 3, since these
    are the sequential records created in buffer.
    In sourcing cockpit, workload distribution and POWL, item number is
    displayed.
    In shopping cart screen, line number is displayed.
    This difference in numbering for line number and item number due to the standard design of SRM 7 is creating a lot of confusion among buyers in our organization.
    Has anyone come across this issue?

    Hi,
    As i told this is Std SRM Functionality.
    You can do  one thing if the client agrees.
    in the shopping cart screen add a new column next to the line item
    Case 1 - No line item is deleted
    Line item    Zline item
    10                 1
    20                 2
    30                 3
    40                 4
    Case 2 -Line item 20 is deleted
    Line item     Z line item
    10                 1
    30                 2
    40                 3
    zline item has to key in by the user
    Remember while deleting the line by the user he has to check the Zline item numbering
    You have to add this new line item in the sourcing
    screen also.
    Check whether this soulution works
    (or) convenience the client that they have remember the line item
    Regards
    G.Ganesh Kumar

  • Best Architecture for Fortran Code with Line Numbers

    Hi all,
    I have large fortran 90 file (10+ pages) which I need to convert to LabVIEW.
    It contains several branching statements with Line Numbers, e.g.:
    1000 IF (condition) goto 2000
    I would like to know what is the best architecture to deal with this branching of the program.
    Should I break the sections (based on line numbers) into user events or states?
    Has anyone done similar conversions? 
    Cheers,
    Battler.

    battler. wrote:
    Hi all,
    I have large fortran 90 file (10+ pages) which I need to convert to LabVIEW.
    It contains several branching statements with Line Numbers, e.g.:
    1000 IF (condition) goto 2000
    I would like to know what is the best architecture to deal with this branching of the program.
    Should I break the sections (based on line numbers) into user events or states?
    Has anyone done similar conversions? 
    Cheers,
    Battler.
    I would insert a preliminary step where I would assign a descriptive name to each line number that is the target of a branch. The names become the names of the states (like Christian was hinting at) then diagram the code into a state transition diagram. The rest gets passed to a developer to complete.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for