How to save/load JTextPane to/from file?

One of the simplest questions re Swing.
How to save a JTextField onto a file?
And, how to read back it onto a newed JTextPane?
Yes, I have searched, searched and searched on the net, in vain.

Assuming he's wanting to do the reasonable thing, I'm trying to do it too.
linuxoid, I suspect he (and I) are looking for a way to save the contents. After all, a control that you can't get the information out of is pretty useless.
Styled text is often just a BLOB to the rest of the app. It is in my case, and it probably is in his.
I'm having the same trouble he is.
I want to make a JTextPane, let the user edit it, then get some reasonably portable representation of it's current contents that I can serialize. A string representation of XML sounds dandy. Incomprehensible binary is acceptable. A representation in some markup language that I can insert in some other document and have it act like I'm inserting text in the editor would make me more than happy.
Ideally, what I, and probably he, are looking for is something like
JTextPane myPainIsGreat = new JTextPane();
... life goes on...the user writes poetry and turns the words tacky colors...
String thisICanDealWith = myPainIsGreat.getStyledTextRepresentation();
knowing better I'd settle for
myPainIsGreat.writeStyled(someWriter)
sadly, JTextPane's write just returns unstyled text

Similar Messages

  • How to save my emails and adressbook files from an old ibook?

    How to save my emails and adressbook files from an old ibook (bought around 2002) ?
    The screen from the old ibook doesn´t work anymore (logicboard problem I guess).
    I saved everything else with starting it in target modus. That worked fine.
    I want to delete the files after that as well, because I wanna give away the old ibook and don´t want anyone to read my emails!
    Little helpers I have:
    A running MacBook
    External Screen (and cables to connect)
    Fire Wire Cable

    Don't know how helpful this will be but I often copy mail from one computer to another, I drag the mail from the mail window to the other computers drop box, then from the other computer double click it and mail asks me what I want to do with it, of course without a screen you'd need to use back to my mac.
    If you don't have back to my mac running, you could set up a second user account on the newer mac, import everything via target mode as suggested by c above, and then drag the mail to the first user account drop box.

  • I have hierarchy data in R/3 side how will i load that data from R/3 to BW

    Hi all,
    i have my hierarchy data in the R/3 side how will i load that data from  R/3 to BW side
    Regard
    Kiran Kumar

    Hi Kiran,
    Here is the procedure:
    1.      In the Data Warehousing Workbench under Modeling, select the InfoSource tree.
    2.      Select the InfoSource (with direct update) for the InfoObject, to which you want to load the hierarchy.
    3.      Choose Additional Functions® Create Transfer Rules from the context menu of the hierarchy table object for the InfoObject. The Assign Source System dialog box appears.
    4.      Select the source system from which the hierarchy is to be loaded. The InfoSource maintenance screen appears.
    ○       If the DataSource only supports the transfer method IDoc, then only the transfer structure is displayed (tab page DataSource/Transfer Structure).
    ○       If the DataSource also supports transfer method PSA, you can maintain the transfer rules (tab page Transfer Rules).
    If it is possible and useful, we recommend that you use the transfer method PSA and set the indicator Expand Leaf Values and Node InfoObjects. You can then also load hierarchies with characteristics whose node name has a length >32.
    5.      Save your entries and go back. The InfoSource tree for the Data Warehousing Workbench is displayed.
    6.      Choose Create InfoPackage from the context menu (see Maintaining InfoPackages). The Create InfoPackage dialog box appears.
    7.      Enter the description for the InfoPackage. Select the DataSource (data element Hierarchies) that you require and confirm your entries.
    8.      On the Tab Page: Hierarchy Selection, select the hierarchy that you want to load into your BI system.
    Specify if the hierarchy should be automatically activated after loading or be marked for activation.
    Select an update method (Full Update, Insert Subtree, Update Subtree).
    If you want to load a hierarchy from an external system with BAPI functionality, make BAPI-specific restrictions, if necessary.
    9.      If you want to load a hierarchy from a flat file, maintain the tab page: external data.
    10.      Maintain the tab page: processing.
    11.      Maintain the tab page: updating.
    12.      To schedule the InfoPackage, you have the following options:
    ○       (Manually) in the scheduler, see Scheduling InfoPackages
    ○       (Automatically) using a process chain (see Loading Hierarchies Using a Process Chain)
    When you upload hierarchies, the system carries out a consistency check, making sure that the hierarchy structure is correct. Error messages are logged in the Monitor. You can get technical details about the error and how to correct it in the long text for the respective message.
    For more info visit this help pages on SAP Help:
    http://help.sap.com/saphelp_nw04s/helpdata/en/80/1a6729e07211d2acb80000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/3d/320e3d89195c59e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6729e07211d2acb80000e829fbfe/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4dae0795-0501-0010-cc96-fe3a9e8959dc
    Cheers,
    Habeeb

  • How to save query result in excel file

    Hi all,
    How to save query result in excel file from sql*plus tool.
    thank you

    Do you really need an Excel file (binary) or a simple CSV?
    If you just need a CSV then search for DUMP_CSV at http://asktom.oracle.com or at this forum
    If you need formatting and/or multiple worksheets then you can use free tools like
    https://xml-spreadsheet.samplecode.oracle.com/ or https://exceldocumenttype.samplecode.oracle.com/
    Regards
    Marcus

  • How to save infopath form in XML file

    How to save InfoPath form in XML file.
    I want every new record in InfoPath form save in XML file and also retrieve these records from XML like databases

    Hi,
    Based on your description, my understanding is that you want to save InfoPath form in XML file.
    I have done a test in my SharePoint, Do the following steps:
    Create an form library and publish an InfoPath form into it, Then when we create new document into the form library, it is by default that InfoPath form is saved in XML file.
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • How To Save Screen Shot Photo From iPAD to JPEG FORMAT

    How To Save Screen Shot Photo From iPAD to JPEG FORMAT

    The "iPad format" is PNG (which is better quality than JPEG).
    There is no way to choose JPEG at the moment of taking the screen shot. You will need to convert the file using conversion software, probably on your computer. Google "convert PNG to JPEG".

  • How do I load music videos from my computer to my iPad when I don't have import in my iTunes

    How do I load music videos from my computer on to my iPad when I don't have "import" on my iTunes?

    Could you explain more? WHat do you mean that you do not have "import" on iTunes? Are you trying to find an import command to add the videos to your iTunes media library? It is called Add to library and is found in the iTunes File menu.
    But you can add files to the iTunes media library by just dropping the files onto the iTunes icon.

  • How can i load a VI from LABVIEW ver 6.0.1b3 to LABVIEW ver 6.1

    How can i load a VI from LABVIEW ver 6.0.1b3 to LABVIEW ver 6.1......I want to load a vi but i'm getting this error:
    LabVIEW load error code 9:VI version (6.1) is newer than LabVIEW version (6.0.1b3)
    My LabVIEW ver is 6.1
    Please help ......it's important
    Thanks

    I am having similar issues with a *.exe from LV6.1.  I have the runtime engine for 6.1 and recently upgraded to 8.2 from 7.1.  I've never had 6.1 on my machine.  I am able to install this executible and runtime engine on a machine with 7.1 and can run the *.exe fine. 
    I get a load error and am not sure why.  I have had similar issues with old VI's that I have written in 7.1 executing on this machine w/ 8.2
    any suggestions.
    Attachments:
    error.zip ‏14 KB

  • How do I load a movie from my iTunes library to my ipad?

    How do I load a video from my iTunes library on my desktop to my iPad

    Sync the movie with iTunes.
    Connect the iPad to the computer, launch iTunes, Select your iPad on the left side. Click on the Movies Pane in iTunes on the right. Click on the movie that you want to sync. Make sure that the Sync Movies headings is selected as well. Click on Sync - or Apply - in the lower right corner of iTunes.

  • How to save Android contacts as Excel file on Mac computer?

    I want to manage and edit my contacts on my cell phone, my friend suggested me save them as Excel format! So now i am trying this way, but i can't find the right method to do this! Do you know how to save Android contacts as Excel file on Mac computer?

    If you want to save Android Phone contacts to Excel format, you can have a try the following method:
    Step 1. Connect Your Android Phone to Computer
    After downloading and installing the Coolmuster Android Assistant software on your computer, launch it and you will get the program interface prompts you to connect your phone to the computer. Just use a USB cable to connect your phone to the computer and the program will detect the connected phone automatically. If it is the first time to run this software, you may encounter the following picture and be required to enable USB debugging on your phone at first. If your device can be detected by the program, you can directly skip to the next step.
    Step 2: Go to the Contacts windows
    All your phone data are categorized on the top menu. To transfer Android phone's contacts, you can go to click the "Contacts" icon to enter the Contacts window. Navigate to the left panel and click on the "All Contacts" option, then, all the contacts in your phone will show in list on the right window. Mark the contacts you want to backup on your computer and click the button of "Backup".
    Step 3. Start to export contacts to computer at once
    Once you click on the "Backup" button, there will be a "Path" dialog appears, asking you to choose an output location where you want to save the exported contacts. Specify an output folder and then click the "Ok" button. Then, all your phone contacts will be exported to the output location immediately, with all the email address, company's name, home address, and more contacts info perfectly kept in the output CSV or XLS file.

  • How do I load photo's from a mac running OS X10.4 to my IPad 3?

    How do I load photo's from my Mac running OS X 10.4 to my IPad 3?

    Get an SD card, an SD card reader for your mac, and get the SD card reader adapter (camera connection kit) for the iPad. You can then upload your photos from the Mac to the SD card using the card reader. Then plug in the SD card reader adapter for the iPad and stick your SD card into it. You can then upload the photos to your iPad.
    You want a camera connection kit (for ipad); you can get it on the apple store.

  • How to save iMovie project as .mov file?

    That's my question!

    Dr.E wrote:
    How to save iMovie project as .mov file?
    That's my question!
    Share/Export with Quicktime
    That's my answer, and Welcome, Dr.E to the  boards ...

  • How to save video messages to a file on Mac?

    How to save video messages to a file on Mac? Please, help. Thank you.Claire

    Claire, I use a Mac w/ the latest copy of Skype and it IS possible to first play the file and then download it.  Steps are available for it but it involves some technical wizardry that can be above some muggles.   Then I found a post where some some VERY bright person made a small downloaded program for the Mac which once the video message has been played recently, you can run this program and download the file for safe keeping ( ALWAYS BACKUP or store it in the cloud for safety )  Kudos are deserved to user alvarop for this! http://community.skype.com/t5/Mac/Video-Message-Exporter-App/m-p/2351609 It worked for me to download a video message that I recently played back.  Let me know if you need any assistance getting it downloaded you can PM me on here and I'll be happy to help with a screenshare. Best Regards,-Shawn G

  • How do i load selected pics from my mac to my ipod touch?, How do i load selected pics from my mac to my ipod touch?

    How do i load selected pics from my Macpro to my ipod touch?

    You really need to read the manual.
    Open itunes, connect ipod, go to photos tab, select what you want, sync.
    iPod touch User Guide (For iOS 5.0 Software)

  • Does anyone know how to down load a photo from the ipad2 to an amazon seller account to sell an item?  Do I have to download an app for this?

    Does anyone know how to down load a photo from the ipad2 to an amazon seller account to sell an item?  Do I have to download an app for this?

    You can use 3rd party apps like Photo Transfer App.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%205/79b3173fda7b6a6e148 5b463198f6acf.jpg

Maybe you are looking for

  • HR - Programming without Logical database

    Hi All I have some doubts, I am mainly using Logical database while creting Reports in HR, if I want to use HR function modules and BAPI do they use logical database, question is when we have to do HR programming with Logical database and when withou

  • Jabber 9.2.7 and CUCM 9.1 Directory Profile

    Hi Does jabber 9.2.7 uses Directory UC services on CUCM 9.1 for directory Search?. I have configure but it does not seems to work, data does not show on the "show connection status" of the Cisco Jabber Client.

  • VGA to ADC adapter?

    I have an older 20" Apple Studio Display that uses an ADC input, which I can use with my Powermac G5. I would also like to use the display with a PC laptop that only outputs VGA. Is there an adapter that will let me run the ADC monitor from a VGA sou

  • Can two different SRM clients systems connect to one R/3 Back-end system?

    Hello, Trying to developing SRM Co-Exist/Global strategy, based on the following scenario: 1.  Two different SRM client systems, each at DIFFERENT SRM Version/Release Level.  SRM system "A" runs in Stand-Alone and Extend Classic Scenario mode.  SRM s

  • Amber Blinking Light....

    I just got an airport extreme today and it does not work. I have tried everything and am 95 % sure its hooked up correctly. I have a dsl modem with sbc as my provider. Everytime i plug in the airport, it flashes amber. I have read that section in tro