Loading text problem

Hi.
I am hoping that someone can help me here. I am creating an Applet as part of a college project and need to be able to save and load data from a TextArea. I have managed to get the file to save but I can't seem to get it to load. No error message pops up after I load the same file, but no text appears in the TextArea. I am providing the class DiaryData and the code extracts for the Load and Save routes. Can someone tell me how to get this working please.
DiaryData
import java.io.*;
public class DiaryData implements Serializable
private String DiaryText;
// Default constructor
public DiaryData()
DiaryText = null;
// Set DiaryText to text in applet
public void setData(String passText)
DiaryText = passText;
// Return DiaryText
public String getData()
return DiaryText;
Load
void Bload_Action(ActionEvent event)
// Load data
try
FileDialog FileBox;
Frame MW = new Frame("MyFrame");
FileBox = new FileDialog(MW,"Open File",FileDialog.LOAD);
FileBox.setVisible(true);
myPath = FileBox.getDirectory() + FileBox.getFile();
File infile = new File(myPath);
FileInputStream inStream = new FileInputStream(infile);
ObjectInputStream myOIS = new ObjectInputStream(inStream);
DiaryData theDD = (DiaryData) myOIS.readObject();
myTextArea.setText(theDD.getData());
inStream.close();
myOIS.close();
catch(Exception e)
JOptionPane.showMessageDialog(null,"Error! " + e);
Save
void Bsave_Action(ActionEvent event)
// Save data
try
dd.setData(myTextArea.getText());
FileDialog FileBox;
Frame MW = new Frame("MyFrame");
FileBox = new FileDialog(MW,"Save File",FileDialog.SAVE);
FileBox.setVisible(true);
myPath = FileBox.getDirectory() + FileBox.getFile();
File outfile = new File(myPath);
FileOutputStream outStream = new FileOutputStream(outfile);
ObjectOutputStream myOOS = new ObjectOutputStream(outStream);
DiaryData theDD = new DiaryData();
myOOS.writeObject(theDD);
outStream.close();
myOOS.close();
catch(Exception e)
JOptionPane.showMessageDialog(null,"Error! " + e);
Any help is grately appreicated.

DiaryData theDD = new DiaryData();
myOOS.writeObject(theDD);Duh! What do you think that writes to your file? Do you think it magically calls your setData method? You called setData on a "dd" instance but you're not writing that one, now are you?

Similar Messages

  • Problem displaying dynamically loaded text in Flash CS3

    I created a Flash CS3 application that does not display
    dynamically loaded text (from internal AS3 scripts) on 3/6 of my
    client's computers. All computers run IE 6 and Flash Player 9. I
    cannot replicate the problem on any computer in my department. The
    problem seems to be related to Flash Player 9 or a browser
    setting/IT restriction. Has anyone encountered this? If so, have
    you found a solution?
    If I cannot find a solution, then I will need to almost
    completely redo the application.
    One slightly insane idea I have considered is to, if
    possible, convert dynamically loaded text to an image real-time. Is
    that possible?
    Btw, I have created a font in my library. Should I try
    manually embedding the font from the Properties menu and selecting
    all characters?
    Thanks in advance.

    yes, even though you may be using a font from the library,
    you still have to specify that each text field that uses that font
    embeds the font, and you'll need to select all characters(well not
    all, unless you require all the different scripts of the world -
    upper-case, lower-case, numerals and punctuation usual suffices).
    I bet if you checked, the computers where the font did not
    appear did not have the font on their system.
    Good luck
    Craig

  • Flash CC Air iOS: Problems with loading text from an external xml located on a server.

    So I have this code allowing me to load text from an xml located on a server. Everything works fine on the Air for Android. The app even works in the ios emulator, but once I export my app to my ios device with ios 7, I don't see any text. The app is developed with Air sdk 3.9. What could be the reason? Do I need any special permissions like on Android? Does ios even allow to load xml from an external server?
    Any clues?

    It was my bad. I linked to a php file to avoid any connection lags, which was absolutely fine on the android, but didn't seem to work on the ios 7. So all I did is change the php extension to xml and it worked without any problems.

  • Problem loading text master data for one value

    Hi guru's,
    We are trying to load texts for an standard characteristic (data element : Char 30). The problem comes with characteristic value 4700112703/04/19 , all other values load correct but this one is recognized by SAP as an incorrect value. It seems, by the PSA explanation, that the / is incorrect.
    Do you know why this value is incorrect ? Is there any way to load this record to the characteristic ?
    Thanks in advance.

    Hi,
    In RSKC specify the value as ALL_CAPITAL which would allow all the necessary and SAP supported values(including /) to come into BW.
    Refer this blog for more information
    /people/sap.user72/blog/2006/07/23/invalid-characters-in-sap-bw-3x-myths-and-reality-part-2
    Regards,
    Rik

  • I am having problems with my droid incredible 2 loading texts and so I thought maybe I had too many saved, I tried to delete some of them and it wont seem to delete either?

    I am having problems with my droid incredible 2 loading texts and so I thought maybe I had too many saved, I tried to delete some of them and it wont seem to delete either?

    Did you pull the battery?

  • Problem while loading texts and authorization objects file in RAR

    Hi all,
           i am getting internet explorer error while loading the texts and authorization objects text files in RAR .actually we uploaded rule file before this,does this step causes any error ?if so how to resolve this error.do i need to remove all rules/risks and then load text and authorization files? is there any shortcut to renove all risks generated in one shot? please reply me soon to resolve this.
    Thanks,
    Joseph.

    Hi Joseph,
    Please make sure to convert both the files in UTF-8 encoding format and then try to upload the files again. This should resolve the issue and if not then please paste the logs here.
    Regards
    Harleen

  • After aborted rebuild in Mail: I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up

    I have searched quite a bit to find a resolution to this problem, with no success. Any help would be appreciated.
    I decided to rebuild my inboxes by following this advice: http://support.apple.com/kb/PH11704. The rebuild took several hours and at 96% (4 minutes remaining apparently), the indexing froze (that is, after 8 hours, the message was still telling me "4 minutes left"). I forced quit mail, restored the previous Envelope files from the trash, and everything seemed fine.
    However, since this failed attempt, I can see and select the message in the center pane and when I click on it to display, I get "Loading" text, but nothing comes up. All messages in my various inboxes have the reloading problem, EXCEPT messages that I downloaded since the aborted rebuild (in other words, there are about 40 messages that I downloaded since I tried the rebuild and I have no problem with these). The other 70,000 messages however wont load, even though I can see them in the centre pane and spotlight has no problem finding them and showing me their contents (when I hover the mouse over the message). When I click on the message in spotlight, mail opens and the loading problem re-occurs.
    Since then, based on various suggestions I found for similar issues, I have used Disk Utility to verify and repair permissions and the drive. I used Onix to rebuild the Mail index (that only took about a minute - I am not sure how to interpret this when compared to the hours the rebuild took with Mail). No joy, I still have the same problem. I even restored one of my inboxes via Time Machine and the same issue with loading continues.
    I am using ML 10.8.2. I have a combination of IMAP accounts (work) and POP accounts (personal). The issue of loading occurs irrespective of the account.
    I am baffled and am now considering migrating to either Thunderbird or Postbox 3 to try and solve my problem. I prefer to stay with Mail. I should note also that I am using MailTags with Mail (http://www.indev.ca/MailTags.html), although I have not used any of the features. I upgraded to ML from SL about 2 weeks ago. It was very smooth and there appear to be no issues (not sure how helpful this is and probably not at all related to this issue).
    Any suggestions much appreciated!

    Maybe these will help:
    https://discussions.apple.com/message/17677533#17677533
    https://discussions.apple.com/message/18324129#18324129
    https://discussions.apple.com/message/18203126#18203126

  • Corrputed loaded text from an Export Datasource with Unicode

    Hi Experts
    I am new with BW and this forum helped me a lot in the past year.
    I am loading texts to an InfoObject using a Master Data (texts) Export DataSource from another InfoObject. The system is NetWeaver 2004s (BW 3.5) with Unicode.
    The InfoObject's Text MD is Language Dependent but users enter the system only with EN language.
    For some reason the loaded texts are corrupted.
    For example:  The original InfoObject has Hebrew texts (that were loaded perfectly from the source system which is also Unicode), but the text in the PSA table and in the text table of the target InfoObject will be: ###########
    Can anyone help?

    Hi Niraj
    Thanks for your answers
    Let me explain:
    Currently, we load texts with Hebrew chars from the SAP ECC6 system and everything is good (we see Hebrew chars in SAPGUI/BEx/WAD etc.)
    The problem occurs when we load these texts from one InfoObject to another, via Export DataSource.
    To do that, We generated an Export DataSource for the original InfoObject and assigned it to the target InfoSource of the other InfoObject. After running an InfoPackage for this DataSource, the texts that were loaded to the PSA (and hence, to the target InfoObject texts table) were corrupted - which means that they appeared: ##########
    Thanks,
    Yaniv

  • BI 7.0 : Error in loading text of a Master Data with a data source time dep

    I have a problem loading text from the data source(time dep) to the Master Data.
    For instance if the Data Source 0EVALGROUP1_TEXT is time dependent as there are the fields DATETO and DATEFROM, while i create the transformation these 2 fileds does not have any target fields. After i create the infopackage and execute it to load into the PSA, i have a error message : the message says "An error occurred in the source system."and "The error occurred in Extractor "; and the PSA is empty.
    Can anyone tell me if there is an OSS note to apply for this kind of problem, actually we are running under SAPKW70015 SAP_BW.
    Thanks for your help.

    Hi,
    Pl try the below
    The l_dta data target that you want to load is an InfoObject (master data or text
    table).
    You must declare this for the InfoProvider in Transaction RSD1.
    You do this on the 'Master Data/Text' tab by assigning any InfoArea to the InfoObject.
    The InfoProvider (that is, this InfoObject) is then displayed below this InfoArea in
    the InfoProvider tree.
    Rregards,
    Senthil

  • Master data load: texts are not loaded

    Hi friends,
    Trying to load BW Hierarchy(0COSTCENTER) to BPC dimension(P_CC).
    Loadedd master data & text data using package "Import master data from BI infoobject"(/CPMB/IMPORT_IOBJ_MASTER), but EVdescription (texts) are not uploaded ino BPC dimension (P_CC).
    Because of above error, when i try to load hierarchy(0costcenter), sytem throwoing one more error(JScrpit evaluation error).
    Now i want to load texts into P_CC. ours is bpc 75nw sp10.
    Found 2 notes, but these are related to older support packges
    1462732 u2013 DM: text node descriptions canu2019t be imported.
    1531601 - Incident 737084 / 2010 / text nodes aren't loaded
    Transformation file:
    *OPTIONS
    FORMAT = DELIMITED
    HEADER = YES
    DELIMITER = TAB
    AMOUNTDECIMALPOINT = .
    SKIP = 0
    SKIPIF =
    VALIDATERECORDS=YES
    CREDITPOSITIVE=YES
    MAXREJECTCOUNT=-1
    ROUNDAMOUNT=
    *MAPPING
    ID=ID
    CURRENCY=0OBJ_CURR
    *CONVERSION
    DM package run:
    Infoobject: 0COSTCENTER
    set selection: Attributes Controlling area = SP00
                           Hierarhcy: import text node(yes), selected hierarchy, version(empty),memberid(SP001170),level(not filled)
                           language: English, medium description,
                          attiribute list: currency(0OBJ_CURRENCY),controlling area
    fileter by attributes or hierarhies option selection,
    Mode: Update
    Format: internal
    Dimension: P_cc
    package ended with error
    Failed to write text of master data; check the error message
    checked BPC dim, only member ID & currency is updated, but not evdescription.
    Can you please share valuable inputs.
    thanks,
    naresh

    resolved problem.
    Packages given bpc7.5 nw sp10 are is exactly working.
    Mapping section:
    ID=0CO_AREA+ID
    CURRENCY=0OBJ_CURRENCY
    becoz base members are automatically added with controlling area in BW hierarchy on 0costcenter.
    Followed method given in how to guide.

  • Flash wont load text file

    Hi Everyone,
    I have a flash program which reads some data in from a text
    file and stores them in a list box. The problem im having is that
    on one of my computers it works fine, however on the second
    computer, there is no log entry in the
    windows\system32\logfiles\w3svc1 file which indicates that the text
    file has been opened.
    So from this i assume that there is something wrong with
    flash and IIS. Is there someway to turn off the IIS in flash so it
    wont load a "
    http://localhost/test.txt"
    file?
    I think I may have accidentally switched off an option but i
    have no idea where this would have been. Any help would be great.
    Thanks

    hi all
    at last i found the way to load text file in to the textArea
    it's like
    <mx:Script>
    <![CDATA[
    private function loadText():void {
    var l:URLLoader = new URLLoader(new URLRequest('2.txt'))
    l.addEventListener(Event.COMPLETE, finishLoading);
    public function finishLoading(evt:Event):void {
    var myData:String =new String(evt.target.data)
    txtBox.text=myData;
    ]]>
    </mx:Script>
    this should works because it's work with me
    enjoy the code
    Sanji

  • XML Loaded Text Inconsistently Displays Apostrophe

    i have a number of dynamic text fields, all of which have
    text loaded from their respective xml files.
    one of the menu items includes an apostrophe. that apostrophe
    shows up in one area of the site but not in another where it is
    replaced by &apos; .
    these two sections are identical. both dynamic text boxes
    with xml loaded text. one works one doesn't.
    i've double checked everything. everything is embedded, i
    have no idea what the problem is.
    any ideas?
    if you want to see what i'm talking about go
    here and select WORK. JAMIES
    ORGANIC TREATS has no apostrophe because i took it out - it gets
    converted to &apos; in this location. but if you select JAMIES
    ORGANIC TREATS the name pops up in the new section correctly WITH
    the apostrophe.
    they are separate text fields with separate xml files but all
    of them are treated the same.
    Flash CS3 Flash Player 8 AS2
    Mac 10.5

    *SOLVED*
    i went back in and enabled html on the text box and changed
    all of the .text to .htmlTxt and it worked. also added the cdata
    tags.
    but any idea why the apostrophe works correctly in the other
    instance?

  • Interacting with flash via a loaded text?

    Here's my problem:
    I have a project with loads of text ergo I am loading text
    from external files with html formating. Now I have to insert
    videos linked to the text file too (as in "dolor ipsum ... press
    here to view video"). All I need is a code that lets my text
    interact somehow with the movie.
    Can I do it somehow through Javascript/Coldfusion/anything or
    do I have to scrap my text and make things manually ?

    I meant to write asfunction.
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "Motion Maker" <[email protected]> wrote in
    message
    news:e3rpfa$7jh$[email protected]..
    If by "text interact somehow with the movie" perhaps you need
    to look at AS
    function and call an Actionscript function that loads the
    external video.
    http://livedocs.macromedia.com/flash/8/main/00001719.html
    Example there shows how to work it with external sound.
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "pixelfreak01" <[email protected]> wrote in
    message
    news:e3mu2q$gf6$[email protected]..
    Here's my problem:
    I have a project with loads of text ergo I am loading text
    from external
    files
    with html formating. Now I have to insert videos linked to
    the text file too
    (as in "dolor ipsum ... press here to view video"). All I
    need is a code
    that
    lets my text interact somehow with the movie.
    Can I do it somehow through Javascript/Coldfusion/anything
    or do I have to
    scrap my text and make things manually ?

  • How to make mouseover scroll buttons attached to textarea with external loaded text ?

    Hi,
    I am working in Flash CS3 and AS3, and I'm not good in
    scripting.
    I want to make a dynamic textarea with loaded text from an
    external textfile, and then I want custom made arrow buttons to
    start scrolling the loaded text on mouseover (not click) andt stop
    scrolling on mouseout. Ala like in this webpage:
    http://boomjinx.com/
    The part with the loaded text is fine, but I can't manage to
    script the arrow buttons to do what I've just described. Even
    though I have searched the Internet for recipes I just find how to
    scroll loaded text on click or with a scrollbar. This problem is
    starting to drive me crazy!! Is there anyone that have a recipe for
    this??

    Here's one approach:
    First you need to create a dynamic mutline textfield that has
    autoSize properties set to handle a varying amount of text.
    Then you need to embed the font because you are going to use
    a mask over the textfield to define the viewable area of it.
    Then you will use the buttons to change the textfield's y
    property to move the textfield up/down vertically. You will
    probably need to use an ENTER_FRAME event handler so that a
    continuous hovering of a button will cause the textfield to
    continue moving until it either reaches one end or the other or
    when the hovering ends.
    Before you try to tackle that though, just make it so that
    hovering a button will cause the textfield to move up or down one
    increment of distance. Just take it one step at a time.

  • Firefox Podcast and Text problem

    OK, this is simple, in Google Chrome my website podcasts and text load no problem. The podcast plays the text appears. In Firefox it does not.
    I'm pretty certain this is not a text font problem. I can't pin point what it is.
    http://www.tjcarpentershow.com

    There was a bug reported with the Isotope plugin in Firefox 19 (and 20 beta) when using CSS3 transitions. There is a way to force the use of jQuery, but I'm not familiar enough with this plugin to know where you put the code.
    * [https://github.com/desandro/isotope/issues/417 Isotope items disappear on Firefox 19 · Issue #417 · desandro/isotope · GitHub]
    * [http://isotope.metafizzy.co/docs/animating.html Animating · Isotope Docs] - animationEngine
    Now... that may well be a different issue than the one you've identified, but in order to figure out what's going on, I would need a simpler test case.

Maybe you are looking for

  • To change the warning message to error message in VA01.

    I want to change the warning message into error message in the standard VA01 transaction.. The steps I follow : order type --> enter sold to part --> ship to party --> Purch order no --> Req deliv date --> Material --> Order quantity --> SU --> enter

  • How to config bookmark to open up in a Private Window

    How can I set up a sensitive bookmark to open up in a Private Window in Safari 8 by default when I select it?

  • MobileIron + ISE 1.2

    Hi All, I hope, that somebody can help me. I'm trying to setup ISE with MobileIron in order to get MAC authentication bypass for corporate registered mobile devices. I succesfuly set up connection between ISE and MobileIron. Authorization rule is set

  • Why is the static initializer instantiating my class?!

    It seems that the static { ... } blocks for my enhanced classes actually create instances of those classes. Gack! It seems, furthermore, that this is due to the JDO spec itself, whose JDOImplHelper.registerClass() requires an instance of the class be

  • IPad doesn't sync all photos + earlier iPhoto versions work with iPad

    1. I have my iPad set to sync with iPhoto, but the iPad doesn't have all of the photos that are in iPhoto. I get a message that it can't sync IMG_0026.JPG so I wonder if when that photo is reached the sync just stops. Could this be the reason? 2. Als