Saving Text in the JEditorPane

Greetings Folks:
I am creating a chat program and was intending to save the content (I.e. what has been typed into the editor pane by the users) into a file. For this task, I have created a button named "Save", which is supposed to take care of it. However, when it comes to defining the functionality of the "Save" button, I am somewhat clueless. I want the "Save"button, after pressed, to open the directories of the computer (you are probably familiar with what it looks like).
In other words, I want the following option to be enabled:
http://www.thoughtman.com/images/fadetoblack/help/save_avi/save_filename.gif
The portion of my code about the text in the JEditorPane is as follows:
msgBuffer = new StringBuffer("");
_chatArea = new JEditorPane("text/html",_msgBuffer.toString());
_chatArea.setBackground(new Color(225,225,225));
_chatArea.setEditable(false);
_scroll = new JScrollPane(_chatArea);
Regards,
vahid

Try looking at javax.swing.JFileChooser.

Similar Messages

  • Copying saved texts to computer?

    I have a lot of saved text messages on my blackberry curve 8330.  I need to get them all on a computer so I can print them out.  I was able to go to each message and forward as an email.  But, in my saved messages it saved the whole conversation I had with the other person which I need printed out.  But when I forward each text as an email it only forwards the first message not the whole conversation.  Is there any way I can rip all these saved texts off the phone onto a computer so I can have the entire conversations?  Any help would be greatly appreciated.  

    I use this program to print out the information I may wish to keep on file http://www.processtext.com/abcblackberry.html. I have used this for a while now and it always works so long as you make regular backups to allow it access. All you need to do is in the help file included with in it, Yes it does cost something but also does quite a few other things also so it is worth the money spent on it, also useful for restoring items that were deleted from calendar etc.
    When you accept a solution from anyone could you please select the appropriate box.
    Also, select the appropriate Kudos box and click it for the person’s solution you accepted thank you.
    Ian H

  • Transfering saved text to memory card

    hey guys, couldn't find a topic on this, sorry if i missed it. i have a nokia 6555 and just bought a memory card. I want to transfer some saved texts onto the card. is this possible or am i nuts? thanks in advance.

    hi there, yes it is possible to transfer your text messages to your memory card but all at once. you can not just select a few and leave others. here is what you do:
    go to :
    messaging- press left hand button(options)- select settings- scroll down all the way to other. click on other and that is where your option of where you want to store your messages is. i hope this works out for you.
    You know what I love about you the most, the fact that you are not me ! In love with technology and all that it can offer. Join me in discovery....

  • I saved a PDF doc in adobe and then added text to the form. But every time I try an email it it only

    I saved a PDF doc in adobe and then added text to the form. But every time I try an email it it only sends the original form without text. Once I've changed a doc in Adobe, how can I save it so that I'm able to use it with added text and notes? Also, I'm using a new iPad.

    If you are using those apps or websites, they are likely viewing the PDF using iOS' built in PDF previewing, which will not show annotations and markup to the PDF. We have informed Apple of this issue, but do not have any insight into whether or when they will fix it.
    Regarding the qustion about importing pictures, Adobe Reader does not provide any capabilities to import pictures into a PDF. To do this, you'll need to use Acrobat, available on your desktop computer.

  • Why can't I save text I've entered into a PDF file?  When I hit "Save As", only the PDF document is saved, but not the text i typed into the document.  I'm using Windows 8.

    Why can't I save text I've entered into a PDF file?  When I hit "Save As", only the PDF document is saved, but not the text i typed into the document.  I'm using Windows 8.

    THANK YOU!
    Jan Whitfield
    The College Planning Center
    250 Palladio Parkway, Suite 1311
    Folsom, CA 95630
    (916) 985-0453
    www.TheCollegePlanningCenter.com

  • Problem with formatting the saved text to hard disk

    I use a modified code from Macromedia for saving the content of a text filed on hard disk. See code at the end.
    The code works fine and a text file is saved in the given location on the hard disk.
    The problem is that all of the content of the text field appears in a very long single line.
    The line breaks in the text field does not appear at all in the saved text file.
    for example:
    if the following is the the content of the text filed on the stage:
    abcdef
    jhijklm
    nopqrst
    uvxwyz 
    then the saved file is like: abcdefjhijklmnopqrstuvxwyz 
    No line break happens! How can this be fixed?
    Thanks for any suggestions.
    HR
    ******************* Here is the code *************************
    --this handler saves the contents of the field into a text file called 'output.txt'
    --it over writes anything that is in the 'output.txt' file.
    global myFile
    on mouseUp
      if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
      myFile = new(xtra "fileio")    -- Create an instance of FileIO
      openFile (myFile, the moviePath &"output.txt",0)--Open the file with R/W access
      delete(myFile) --deletes the file
      createFile (myFile, the moviePath &"output.txt) --creates the file again
      openFile(myFile,the moviePath &"output.txt,0) --Open the file with R/W access
      mySaveString = member("input").text --puts the contents of the field 'input' into the variable mySaveString
      writeString(myFile,mySaveString) --writes text to the file
      closeFile(myFile) -- Close the file
      myFile = 0 -- Dispose of the instance
    end

    You need to replace the carriage returns (that aren't followed by a line feed) with the CRLF combination. Feel free to place the following JavaScript handler into a movie script and call it prior to writing your string to disk:
    function jsStringToDOS (str) {
      return str.replace(/(\x0D)(?!\x0A)/g, "\x0D\x0A");
    global myFile
    on mouseUp
      if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
      myFile = new(xtra "fileio")    -- Create an instance of FileIO
      openFile (myFile, the moviePath &"output.txt",0)--Open the file with R/W access
      delete(myFile) --deletes the file
      createFile(myFile, the moviePath &"output.txt") --creates the file again
      openFile(myFile,the moviePath &"output.txt",0) --Open the file with R/W access
      mySaveString = member("input").text --puts the contents of the field 'input' into the variable mySaveString
      mySaveString = jsStringToDOS(mySaveString) -- convert to Windows CRLF characters
      writeString(myFile,mySaveString) --writes text to the file
      closeFile(myFile) -- Close the file
      myFile = 0 -- Dispose of the instance
    end

  • If Image is Saved As a Text, Would the Image Text, As a Link, Be Indexed by Search Engines.

    Hi I want to put a text long the height of the brown box.
    The text would be vertical as one looking at the page.
    I believe with page make the text can be rotated.
    If Image is Saved As a Text, Would the Image Text, As a Link, Be Indexed by Search Engines.
    or how else to do this?
    an

    If Image is Saved As a Text
    Impossible. It's either image or text.  Save a JPEG as a Word document.  Try it.  Seriously, change the file extension, open it in Word and see what happens.
    Would the Image Text, As a Link,
    Huh?  You lost me here.
    Be Indexed by Search Engines.
    Indexing of search engines.  Yes, Google sees links and Google sees alt text for images.  Google does not see images nor Flash.

  • I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.

    I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.

    P.S. Site is http://www.coldwatercreek.com

  • I have difficulty pasting text into the file name field(prefix only) while saving files.

    OS: WinXP sp3
    FF: 3.6.3
    I have difficulty pasting text into the file name field (prefix only) while saving files. example: File name is Pic123.jpg and I want to rename it ABC123.jpg and I have ABC loaded into the WinXPsp3 clipboard. When I highlight\right-click\delete "Pic" then attempt to paste the ABC, I get either no reaction, or upon multiple paste attempts, the ABC is appended to the end of the file, after the extension, as "Pic123.jpgABC". If I delete this unwanted suffix, or repeat the process several times, eventually I can delete the unwanted portion of the prefix and paste the desired text. Sometimes it works fine first try, but mostly it takes several tries. I'm using Firefox 3.6.3 but the problem existed in whatever previous version I had too. This issue only occurs when using the delete/paste; I can always manually change the name by typing. Thank you for your help.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    A possible cause is that the server sends a wrong response header.
    The server may not comply to RFC 5987 and sends a wrong Content-Disposition:attachment; filename header.
    * https://developer.mozilla.org/en/Firefox_8_for_developers#Network

  • Saving text written in a string indicator on the front panel

    Hi,
    As a new LabVIEW user I'm trying to type a manual to explain how to use the software program I'm writing. I would like to display it on the front panel in one of the tab windows. There is quite a lot of writing and I would like the user to be able to scroll through the text. I tried inserting a string indicator, right clicking on it and selecting 'visible items'>>'scrollbar'. However, when I saved my changes the writing in the indicator was not saved with the rest of the changes. I'd be grateful for any advice.
    Thanks,
    Adrian
    [email protected]

    Adrian,
    The 'data' in your string indicator was probably not saved as 'default', so that when you closed the VI and re-ran it, it was lost.
    For any data (strings, numbers, etc.) that you want to have as default, you will need to rt-click the indicator/control and under data operations, select 'make current value default' (when you have the data entered).
    Also - add an Invoke node function to force this indicator to display the default data upon initial running of the VI.
    Another way, though, when you have a 'lot' of text, is simply save your info in a text file, and have a VI open the file and display it either as the text file itself, or as input into a string indicator.
    Good Luck, Doug

  • Saving Delivery text without the delivery number

    Hi,
    during delivery creation I need to create a standard item text. I did this using SAVE_TEXT in userexit_save_document and it works fine on the central system. But, the delivery is replicated to our decentral system and the text value is not there. The reason it fails is that the function SHP_BAPI_DELIVERY_REPLICA is called before the COMMIT so the new text is not saved yet.
    I cannot find any userexit before the SHP_BAPI_DELIVERY_REPLICA where the delivery number exists - the number is '$        1'. 
    So...._is it possible to create a text where the delivery number is not generated yet?_
    This is what I have tried with VBELN = '$        1'  and  'XXXXXXXXXX':
            CONCATENATE lips-vbeln lips-posnr INTO l_textname.
            l_headertext-tdobject = l_stxh-tdobject.
            l_headertext-tdname   = l_textname.
            l_headertext-tdid     = l_stxh-tdid.
            l_headertext-tdspras  = l_stxh-tdspras.
            CALL FUNCTION 'SAVE_TEXT'
                 EXPORTING
                      header          = l_headertext
                      savemode_direct = 'X'
                 TABLES
                      lines           = lx_lines
                 EXCEPTIONS
                      id              = 1
                      language        = 2
                      name            = 3
                      object          = 4
                      OTHERS          = 5.
    Any ideas?
    Thanks.

    Hi,
    Try calling the function module SAVE_TEXT with parameter
    insert  = 'X'
    fin orm routine 'USEREXIT_SAVE_DOCUMENT_PREPARE" ,user exit 'MV50AFZ1'.
    Regards
    Vinod

  • When saving a page under text format, the text is limited to 80 columns only, how to extend to 120 columns

    When I save a page under text format, the text is limited to 80 columns only, how to extend to 120 columns (or more)?

    HI K,
    This is the Numbers (Mac OS) forum. Your question about Numbers for iOS will probably get better results posting in the iWork for iOS area. the link will take you there.
    Regards,
    Barry

  • I want to copy the text from the SAVED PASSWORD window so i can make a txt doc for back up.... how do i do it?

    is there a certain file in the '''mozilla firefox directory''' that has the saved passwords ,etc info in TXT form, somewhere on my compputer that i havent discoverd yet?

    @dmcritchie
    I don't see any "sort" done at all on the resulting output. And the code on my page doesn't have any sort functions included, that I can see. ''(I know little about writing Javascript.)'' It sure doesn't "sort" as displayed in the Firefox Saved Passwords window, which is alpha from left to right - chrome:// - ftp:// - http:// - https:// - as the primary sort. And within each of those protocols there are mutli-levels of alpha sort, which are separated by each period in the URL, it seems.
    The resulting output from my page seems like it may be in the order the passwords were originally saved, which is the order that data would have been originally saved in the signons.sqlite file. I can't say that 100% though, as the Profile I used earlier to test that it still works in Firefox 5.0 has been through hell and back over the last 8 or 9 years. I honestly can't remember the last time I started saving passwords from scratch in a new Profile, I have passwords from websites that I haven't been to in the last 8 years in there. I just copy the two password files into any new Profile I may create and I'm then sure I have any of the passwords I have saved since I started using Firefox.
    Sorry, I don't have any idea about how to add another column with (xerox.com) pulled out of this URL (www.office.xerox.com), if I am following you. The script used basically takes the data saved in Firefox an outputs it direct, without modification, just placing that data into the correct place as per the script. I'm not sure that would even be possible, we're already hitting two security alerts in Firefox as it is.

  • Error while saving text as attachment

    Hi All,
      When a layout is generated. I get the following error :
    Error while saving text as attachment , Size of the attachment is maximun than the size allowed.
    I guess the generated layout is automatically saved as attachment. Can any one suggest how to disable the option of automatic saving as attachment
    Thanks ,
    Kaushik

    Hi,
    if you want to keep the automatic saving as attachment you might check note 599680.
    The saving is done normally in method TextGeneration in the underlying Business Object, e.g. BOSALESDOCGEN, BOACTIVITY or BOSERVICETRANSACTION. There you will find the according code lines in the end.
    Regards,
    Wolfhard

  • How to update the sales text in the Sales Order.

    Dear all,
    I want to Update the sales text in the Sales Order. I used the "CREATE_TEXT" but i couldn't update using it.
    Can u please guide me, how to use the Function Module to update the sales Order line item text values.
    Thank U
    Uwanthi

    HI
    Check this link
    User Exit to update Sales order text (Terms of delivery) on saving it
    Regards,
    Krishna

Maybe you are looking for

  • Slatebook keyboard

    I have a SlateBook X2.  Using the (hardware) keyboard in the UK layout, I have a problem with the apostrophe.  It enters the wrong character - a U+2018 (left single quote) rather than a U+0027 (apostrophe).  This is a real pain - the spell-checker in

  • Youtube on Nokia x6

    Hello. I am unable to play youtube videos on my new Nokia X6. I do browsing by connecting to WLAN. When I open the pre-installed 'youtube' on X6 and search for any videos, I can find them easily and quickly, but not able to play them. Also my interne

  • New pages made From Template messed up!

    Hello, I have made a template that is not yet finished... I decided to test it out, but when I make new pages from it, the formatting is messed up (in any new pages that I create from the template). This of course is happening prior to uploading to t

  • Dynamic change of bom qty ijn VC

    hi all i have a case of variant configuration in which the qty of the components have to be entered at the time of sale order. below is a small example. i have a class called interfaces in which i got values card1, card2, card3 for which i have defin

  • Mail does not display pictures in MT Lion

    I do not get pictures in Mt. Lion.  I have tried the html selection both checked and unchecked to no avail. For other mail I get a link to display in browser, previously it displayed in the body of the email. Is this an added "benefit" of Mt. Lion or