How to remove the blank lines at the end of the JTextArea .

Hi,
I need to remove the blank lines in the JTextArea at the end. Suppose i am giving 'A' in the first line and press the enter key two times, after i am giving the 'B' in the third line and press enter key for two times. I need to remove, the last two lines of JTextAreae, . How i can remove these lines?

String#trim() removes all whitespace from both ends of the String.
The requirement was to remove line breaks from the end of the String only.
String#replaceAll with a suitable regex would do the trick. Untested regex for this:text.replaceAll("[\\n\\r]+$", "")db

Similar Messages

  • How do I remove a blank line in the tool bars area?

    I have a blank line between a couple of the lines in the toolbar area(Between the back/forward/home/reload line and the Googlebar Lite line. How can I remove this extra blank line/space?

    This issue can be caused by an extension or plugin that isn't working properly.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]

  • How to set a dropdown to the blank line value

    Hi all,
    maybe a very easy question.
    How can I set a dropdownbyindex value to the blank line?
    If I use e.g.
    wdContext.currentActionsElement().setDescription(null);
    it adds another blank line among the values and if I try with:
    wdContext.nodeActions().setLeadSelection(0);
    it doesn't work.
    Any suggestion?
    Thanks in advance.
    Angelo

    wdContext.nodeActions().setLeadSelection(IWDNode.NO_SELECTION);
    Check that node selection is not mandatory (i.e. selection cardinality is 0..1, not 1..1).
    If this does not help set initializeLeadSelection to false for this node.
    VS

  • Unable to remove the "blank" line at the end of the file

    Hi Experts,
    My requirement is to send data in 'Binary' form as an attachement to a mail address. I have followed as below.
    Converted data into Binary form using the FM 'SCMS_TEXT_TO_BINARY'
    Call FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail.
    Until this point, all works fine and I receive a text file as well. Howvever, a blank line gets appended at the end (after last line) of the file. Please let me know, how I would get rid-off this empty line. Please refer attachment.
    Thanks in advance !

    Thanks Manish.
    I have resoved the issue, following steps have been incorporated.
    1. Find the output length of the file from the exporting parameter(output_length) of the Function module 'SCMS_TEXT_TO_BINARY'
    2. Pass the output length to DOC_SIZE component to the second line of the itab packing_list of function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
    3. Pass the output length to DOC_SIZE component to document_data of function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
    So there it is, the blank line is gone....
    Regards,
    Umar Ali

  • How to display the blank lines in between the message using SO_NEW_DOCUMENT

    Hi,
    I want to display the blank lines in between the paragarph of message using the function module  SO_NEW_DOCUMENT_ATT_SEND_API1.
    Regards
    Nagendra

    Hi Rajesh,
    Try using this code:
    CLASS: cl_abap_char_utilities DEFINITION LOAD.
    data: lf TYPE C VALUE cl_abap_char_utilities=>CR_LF.
    move lf to wa_lines.
    append wa_lines to li_lines.
    Hope this helps!
    Regards,
    Saumya

  • How do I remove a blank line in a pdf with  adobe pro XI?

    How do I remove a blank line in a pdf with adobe pro XI?
    Can I combine text blocks into one paragraph that are now given line by line?
    Is there a way to add a paragraph to an existing pdf and have the remaining text flow to the next pages?

    You can't, no, and no. Acrobat is not a word processor, and trying to use it as if it is will lead to enormous frustration and disappointment. Maybe you need to convert this document to Word if you want to do this sort of editing, but don't expect fancy layout to be preserved.

  • How to remove bullets and spacing for url links in the Related Links iview?

    I tried to look for a property that I can edit the look-n-feel of the url links in the Related Link iView using "Theme Editor".
    All I need is to remove the bullets and increase some vertical spacing between the links.
    Currently, it looks like this:
    URL iView A
    URL Iview B
    I go through the whole section of Related Links properties, none of them seems to do what I want.
    Here are the list of properties in Related Link section (of Navigation Panel):
    Link Color
    Text Decoration of Link
    Hover Color
    Text Decoration of Hovered Link
    Initially, I thought "Text Decoration of Link" should be the right property I should look at. But there are a drop-down with 5 options: None, Underline, Blinking, Overline and Line-Through, which really can't achieve what I want.
    Thanks for advice.
    Kent
    Post with Diagram Illustration:
    <a href="http://sapnetweaverforum.blogspot.com/2006/11/how-to-remove-bullets-and-spacing-for.html">How to remove bullets and spacing for url links in the Related Links iview?</a>
    Message was edited by: Kent C.

    Hi, Kai.
    I checked the Related iView properties (URL Template), I don't see what layoutset it is really using. I am not sure, is that a layout set apply to the Related Link Iview?
    For the regular KM iView, I will see what Layout Set I want to apply, then I can go and change the properties (of layout coontroller, collection renderer & resource renderer)you mentioned. But for this Related Link iView, I really don't know. I guess it may be in the code itself.
    If there is a layout set for Related Link iView (or the place to apply layout set to it), can you point to me which one is that? (I did a search through the layout set names, I only find the AppQuicklinkExplorer (I used this for Dynamic Nav. Link iView before), if I can aply this layout set to Related Link iView, my problem will be solved.)
    Thanks for help.
    Kent

  • I'd like to remove a thin line that is part of the page design in one of Aperture's photo books.  I can't seem to make it happen.  Any suggestions?

    I'd like to remove a thin line that is part of the page design in one of Aperture's photo books.  I can't seem to make it happen.  Any suggestions?

    The mouse that came with my Mac does not have a right click feature. When I try to highlight and click, it just opens the link I don't want anymore. What I want to do is remove unwanted links from the top bar. For example, I no longer use GoodSearch or myEarthLink, but I can't delete them. There are also some links that never should have found their way up there, and I don't know how they ended up there, and I can't remove them either. I've read through a ton of questions and answers, and I can't find one that addresses the problem. With my Safari browser, all I have to do to remove an unwanted link is to click and drag it to the trash. It doesn't appear to work that way with Firefox, to my chagrin. I hope this better explains my question. Maybe that will give you a better insight into a solution.

  • I have 0,3€ credits. How can remove them so that I can change to the app store of another country?

    I have 0,3€ credits. How can remove them so that I can change to the app store of another country? I need to change to the Chinese app store as the apps I am looking for can be only found there. Thanks for all answer in advance!

    Click here and ask the iTunes Store staff to zero your account balance. Note that if you're not in China, you won't be able to use the Chinese App Store.
    (125951)

  • Can I block the blank lines in delivery note?

    Hi Experts,
    I want to block the blank lines when creating or changing delivery note because  I don't want user to add new items manually.
    Can I realize such a requirement?
    Hope anyone can give me some solution.
    Thanks.
    Best regards,
    Chris Gu

    Go to OVLK,  select the delivery type and execute.  There maintain routine 201 against the field ItemRequirement.  Similarly, for new item category, go to zero184  and donu2019t maintain any item category under the tab MItC
    thanks
    G. Lakshmipathi

  • I am a beginner of "pages" and have this problem of dots while writing the text. I dont know how to remove these bullets-like dots while spacing in the text. Please help

    I am a beginner of "pages" and have this problem of dots while writing the text. I dont know how to remove these bullets-like dots while spacing in the text. Please help

    Look up "formatting" in the User Guide.
    http://manuals.info.apple.com/MANUALS/0/MA524/en_US/Pages_UserGuide.pdf

  • I'm selling my early 2011 MBP because I just bought a iMac. Could someone please tell me how to remove all my information from it but leave the OS working. Thanks so much.

    I'm selling my early 2011 MBP because I just bought a iMac. Could someone please tell me how to remove all my information from it but leave the OS working. Thanks so much.

    How do I securely delete data from the machine?
    Erase, formatting, OS X installs on Mac's

  • Reporting Toolkit: How to insert a blank line into an MS Word Report?

    Hello,
    I have created an MS Word report, but I haven't been able to find out how to "write" a blank line to the report.  I've tried every combination of \n, \\n, "\n", '\n', \\n etc., but I haven't had any good luck.
    Thanks,
    Chris

    Hello,
    If you're using "append report".vi it's has one input for "new line".
    Message Edited by Jorge Amaral on 05-02-2008 03:28 PM
    Software developer
    www.mcm-electronics.com
    PS: Don't forget to rate a good anwser ; )
    Currently using Labview 2011
    PORTUGAL
    Attachments:
    append.PNG ‏3 KB

  • Html tags - how to add a blank line

    Hi there,
    can anyone tell me how to add a blank line into a page using one of the html tags ?
    thanks,
    Malcolm.

    You can use the <br> tag for a line break. Also   for space.
    Regards,
    Arun

  • Removal of Blank Line

    hi,
    I have an issue here. We have a field with VARCHAR2 data type.
    This field can have value like this:
    ====================================
    YOUR SWIFT XXXXXXX UNDER A.M L/C
    PLS NOTE THAT DOCS. NOT PRESENTED YET
    BUT WE SENT INQUIRY TO REIMBURSING BK
    TO CONFIRM THAT THEY HOLD REIMBURSMENT
    AUTHORITY TO HONOUR OUR CLAIMS FOR AMT
    OF COMPLYING DOC. WHICH WILL BE PRESENTED
    TO US AS PER L/C TERMS KINDLY INSTRUCTE
    THEM TO HONOUR OUR CLAIMS QUOTING OUR REF.
    LOC1435 UNDER ADVISE TO US
    THANKING YOU INADVANCE FOR YOUR KIND CO-OPERATION
    REGARDS
    ==========================================
    if you notice, you will find two blank lines after first two lines. I would like to remove the blank line and move the next line up.
    Please advise.
    Regards
    Nanjunda

    If you are under 10g :
    SQL> select mycol from mytable;
    MYCOL
    YOUR SWIFT XXXXXXX UNDER A.M L/C
    PLS NOTE THAT DOCS. NOT PRESENTED YET
    BUT WE SENT INQUIRY TO REIMBURSING BK
    TO CONFIRM THAT THEY HOLD REIMBURSMENT
    AUTHORITY TO HONOUR OUR CLAIMS FOR AMT
    OF COMPLYING DOC. WHICH WILL BE PRESENTED
    TO US AS PER L/C TERMS KINDLY INSTRUCTE
    THEM TO HONOUR OUR CLAIMS QUOTING OUR REF.
    LOC1435 UNDER ADVISE TO US
    THANKING YOU INADVANCE FOR YOUR KIND CO-OPERATION
    REGARDS
    SQL> select regexp_replace(mycol,(chr(10)||'{2,}'),chr(10)) from mytable;
    REGEXP_REPLACE(MYCOL,(CHR(10)||'{2,}'),CHR(10))
    YOUR SWIFT XXXXXXX UNDER A.M L/C
    PLS NOTE THAT DOCS. NOT PRESENTED YET
    BUT WE SENT INQUIRY TO REIMBURSING BK
    TO CONFIRM THAT THEY HOLD REIMBURSMENT
    AUTHORITY TO HONOUR OUR CLAIMS FOR AMT
    OF COMPLYING DOC. WHICH WILL BE PRESENTED
    TO US AS PER L/C TERMS KINDLY INSTRUCTE
    THEM TO HONOUR OUR CLAIMS QUOTING OUR REF.
    LOC1435 UNDER ADVISE TO US
    THANKING YOU INADVANCE FOR YOUR KIND CO-OPERATION
    REGARDSNicolas.

Maybe you are looking for

  • Issue with blank screen HP G60-447CL Notebook PC

    Issue with blank screen  HP G60-447CL Notebook PC, I purchased warranty and have had the laptop serviced before for the same exact issue.  Same problem has come up again blank screen it has been less than five months this problem was fixed and it has

  • Printing or saving specific PDF crashes Preview

    My VP e-mailed me a PDF this morning that she couldn't print. I opened it on my Mac, and I also couldn't print it. Every time either of us tries to print it, Preview crashes. It also crashes if I try to Save As. I'm using the current aluminum MacBook

  • Streaming audio not working in IE (works in Firefox)

    EDIT: Problem solved. I upgraded to the latest version of the Flash player, and audio now works. I'm currently working on a presentation, and use SWFObject to run it in a browser. You can see it here... http://asureimage.com/presentations.php The SWF

  • Site Setup in Dreamweaver CS6

    I just downloaded my new copy of Dreamweaver CS6, however when I opened it, it didn't seem to give me the option to set my default site location. It is just set to My Computer. How can I change this?

  • Incremental Checkpoints

    Hi, I have a Oracle 10.2.0.4 Standard Edition database with a manual physical standby on a remote server. To synchronize my stnadby, I'm forcing a log switch then I copy the archive log on the standby site for recovery. I'm having several "Checkpoint