Reached end of file whlie parsing

Hello,
I get the error message "reached end of file while parsing" when I try to compile the below program.
Does anybody know why I am getting this message?
I think my braces are all paired.
Thanks.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class DrawFillRect extends JApplet {
     private MyColorChooser chooser;
     private JButton paint;
     private RectPanel myPanel;
     public void init()
          chooser = new MyColorChooser();
          Container c = getContentPane();
          c.add( chooser, BorderLayout.WEST );
          myPanel = new RectPanel();
          paint = new JButton( "Paint" );
          paint.addActionListener(
               new ActionListener() {
                    public void actionPerformed( ActionEvent e )
                         myPanel.draw( chooser.getCustomColor() );
          c.add( paint, BorderLayout.CENTER );
          c.add( myPanel, BorderLayout.EAST );
}     

The error is likely coming from code that you are not showing us. Look carefully at the error message to see what line of code is setting it off, then start debugging.
edit: please see my message in your other thread. It is considered rude in all societies, including this one, to have received help and not to have acknowledged it. This may affect the willingness of members to help you in the future.
Edited by: Encephalopathic on Aug 17, 2008 8:30 PM

Similar Messages

  • Reached end of file while parsing error

    I have a problem. It looks like my program has no errors but I get an error that says "reached end of file while parsing" (note: this is being developed in NetBeans). Can you help me?
    class LongNumbers {
        public static void main(String[] args) {
            long numbers = 12345678910L;
            int number = 2;
            switch (number) {
                case 1: System.out.println("One\nTwo\nThree\nFour\nFive\nSix\nSeven\nEight\nNine\nTen");
                case 2: System.out.println(numbers);
            int firstArg;
            if (args.length > 0) {
                try {
                    firstArg = Integer.parseInt(args[0]);
                } catch (NumberFormatException e) {
                    System.err.println("Argument must be an integer");
                    System.exit(1);
    }

    Oh, nevermind. I found the problem. The admins can delete this if they want.

  • Re: Need help: error message "reached end of file while parsing"

    You are missing a closing brace "}" somewhere near the bottom half of your code.
    Edit:
    DrClap beat me to it.
    Edited by: Jin on Oct 2, 2007 1:33 PM

    well i just compiled the source that you have posted. it appears that you have declared a variable called "oper" within the Design method and tried to acces it from within the actionPerformed method (line 136). thats a scope error. one way to eliminate this error is to declare the oper var as global variable, i.e. along with the JButtons and stuff.
    another error is at the same place , the last if block. you might wanna use only the equals method like oper.equals("minus"). another way is oper.compareTo.("minus")==0.
    I believe this will hold for now. you may find the following stuff helpful, but probably you know this already.....
    In order to view your applet you can use an html that looks something like this
    <html>
    <body>
    <applet code="calc" width="400" height="400">
    </applet>
    </body>
    </html>
    to test it without a browser issue the command
    java sun.applet.AppletViewer app.html
    where app.html is the above html file and situated in same folder as calc.class file

  • Logical end-of-file reached during read operation

    Hi,
    Something strange happened to my Logic a couple of days ago - all of a sudden. When I start Logic up it gives me the following error message:
    *Error reading/writing file “com.apple.logic.pro.cs”: Logical end-of-file reached during read operation.*
    I have re-installed Logic, as well as updated it (8.0.2), I have repaired disk permissions in Disk Utility, and it still keeps popping up. I cannot get on with my projects and I have deadlines!
    I found an IT support site, according to that I don't have enough space on my HD. However, I do... I'm confused, and desperately need help.
    Thank you so much, I'm looking forward to hearing from somebody.
    Agnes

    I am not opening any files, just launching Logic.
    I know. And when you launch Logic, it loads its preferences files - and it seems this is failing - most likely due to file corruption. So delete the file, as I said, and Logic should load fine.

  • Unable to display tree view; Error when parsing an XML document (Premature end of file.)

    Hi folks,
    I am using a cascaded mapping in my OM. I have a graphical mapping followed by the Java mapping. It is a flat file to IDOC mapping. Everything works fine in Dev but when I transport the same objects to QA, the Operation mapping though it doesn't fail in ESR testing tool, gives the following message and there is no output generated for the same payload which is successfully tested in DEV. Please advise on what could be the possible reasons.
    Unable to display tree view; Error when parsing an XML document (Premature end of file.)

    kalyan,
    There seems to be an invalid xml payload which causes this error in ESR not generating the tree view. Please find the similar error screenshot and rectify the payload.
    Mutti

  • U201Ccom.apple.garageband.cs\U201D - Logical end of file reached...

    Hello,
    I'm getting two errors. Hopefully someone can help with one or both.
    1) U201Ccom.apple.garageband.cs\U201D - Logical end-of-file reached during read operation.
    From other posts, I've tried to go into Library -> Prefs -> but, there's no file there to delete. I also have reinstalled Garageband, with the same issue popping up.
    2) "Garageband unexpectedly quit." - Not sure what's going on here. Anytime I close the program, it has a 2 second lock-up, and then the yellow triangle with the exclamation point pops up with that message?
    I do not have any 3rd party apps or add-on's.
    Thanks in advance.
    Cheers,
    Sean

    I've tried to go into Library -> Prefs -> but, there's no file there to delete.
    http://www.bulletsandbones.com/GB/Tutorials.html#deleteprefs

  • Keep getting message pop up "Error reading/writing file  "com.apple.logic.pro.cs": Logical end-of-file reached during read operation," and "The Preferences are not loaded completely. Save them to "com.apple.logic.pro.cs" anyway?" Using Logic pro 8. ???

    Logic froze while I was working on something so I forced quit.  Now every time I open LOGIC a message pops up that says:
    "Error reading/writing file
    “com.apple.logic.pro.cs”:
    Logical end-of-file reached during read operation."
    The only button option is cancel so I press it and another message appears that says:
    "The Preferences are not loaded completely.
    Do not save them, as you would overwrite the Preferences file with incomplete data."
    Then when i close logic a box appears saying:
    "The Preferences are not loaded completely.
    Save them to "com.apple.logic.pro.cs" anyway?"
    There are 3 button options to press; ok, cancel or dont save.
    I press "don’t save" cuz I don't want to ruin anything.
    I found a discussion located here: https://discussions.apple.com/message/9564253#9564253 that says if I delete the file "com.apple.logic.pro.cs" it will resolve the problem.  If I do this will I loose or mess anything up at all, automation, saved channel strips customizations, saved effects, synth, or ultrabeat customizations etc? Or especially will I loose any work I've done?  I have hundreds pieces of music files I've created.  I'm scared to mess anything up with all the hours and months of work I've done.  Is there anyway to fix this without loosing anything?  I'm using Logic Pro 8.
    Thank you

    You can safely delete this file - its the preference file for control surface settings - you haven't said whether you're actually using a control surface or not, if so, you will have to set it up again. A new file will be created when you fire Logic up again, but of course it will contain default settings. If you have a complicated control surface setup, remember to keep a backup copy somewhere in case any future problems arise.
    Other than that, you really have nothing to be scared about - hopefully your problem is as simple as that and there isn't an underlying problem (a corrupt hard drive, for example). You seem concerned about losing work, so I guess you want to think about backing that up on a regular basis too. If you're saving your projects to your system drive, do get an external one for this. And also check that you have plent of free space on your system drive - you need to keep about a quarter or third of it free for your OS and programs to run properly (some temporarily stored files can be quite large).

  • Error "logical end of file reached during read operation"

    I am trying to burn a dvd of a wedding I did, and this is the error I am getting. After 5 hours of it trying to burn when I click cancel this it says " logical end of file reached during read operation". Does anyone know what this means, and how I can fix it? I am anxious to get this wedding finished and out to the customer. Any help would be greatly appreciated.

    How long is the wedding video?
    My standard list of things to do first...
    Run MacJanitor (free download) to do all the Unix Cron Maintenance scripts.
    Run Disk Utility (Applications -> Utilities) and repair disk permissions on your start up drive (typically your internal drive). Also verify any other drives mounted on the system.
    Run Preferential Treatment (free download) to check for corrupt/damaged application and system preference files.
    Run Cache Out X (free download) to clear all system and application caches.
    Reboot your Mac.
    If you still can not get it to run correctly, next thing to try is to throw out the iDVD preference file (don't forget to change back those preferences you want different from the defaults next time you run it). If it still doesn't work, then I would suggest you reinstall iDVD.
    Patrick

  • EXS 24 Logical end-of-file reached during read operation Result code = -39

    EXS kit Trip Hop Remix will not completely load. Upon trying to load it I get the error, Logical end-of-file reached during read operation Result code = -39. The kit ends up lacking samples. It worked at one time but now it will not load up. To try and fix I extracted two kits with the same name but oddly they are slightly different sizes and have different creation dates, one 2004 the other 2007 hmmm (one goes in Garage band for remix tools the other gets placed in 02 Electronic Drum kits) from the install disks using Pacifist hoping to replace corrupted files. NG. I also reinstalled all the samples from the LP8 install disk, still NG. Anybody have a solution. THanks.

    To further clarify, the samples are all located in the folder Garage band/.../.../.../Sampler Files/Treated Percussion Sets/Perc-DnB+Triphop. They are used in the EXS24 Trip Hop Remix kit.exs. The 3 samples that seem to be causing the error are, YT2BGLRHTX02_3ue.aif, YT2BGLRHTX03_3ue.aif, YT2BGLRHTX04_3ue.aif. The kit is useless and my song is screwed up now that the kit will not load. Any ideas for a fix out there ?

  • Error: Logical end-of-file reached during read operation. Result Code = -39

    Hello all,
    Recently, I have been suddenly getting this error message:
    "Logical end-of-file reached during read operation. Result Code = -39."
    In my case, when it does come up, it always pops up during the recording of an audio take. Almost immediately after hitting the stop button, this error message would pop up. And then when I go to check the take that was just recorded, there is nothing but shrieking noise. As a result, this pop up error trashes any good take I may have had. It's unpredictable as to when this error decides to pop up as well. So now, when I record, I tend to just have my fingers crossed and hope that this error doesn't pop up especially right after recording a good take!
    To no avail, I have tried different I/O buffer settings, repaired permissions, rebooted, and even re-formatted my recording hard disk.
    Could this be a possible hint that my hard disk is about to physically collapse? I have had it for about 2 years. Could it be some sort of bug in Logic? Or something else perhaps?
    Appreciate any feedback! Thanks a lot!

    DamonGrant wrote:
    Thanks for those suggestions Erik...
    It's been happening for a month I guess and I don't think that anything new's been installed. I will try recording to the start up disc and to maybe to some USB discs I have.
    It seems to happen after working on a project for some time.
    After say tracking takes for 45 mins or so. Maybe it's just coincidence, but do you think that might indicate a hardware issue?
    Now there might be a clue. What happens when you then quit Logic, reboot your Mac, and reopen the active session? It might be that your disk has become a bit messy from all the traffic, and it just needs to 'settle' in OS X again. Click on the *Spotlight icon* top right of your screen and see if any indexing is taking place. Wait for it to finish before launching Logic.
    Alternatively, you could exclude your recording disk from Spotlight indexing alltogether, by dragging the disk to the Privacy field in the Spotlight Sysprefpane.
    One other thing to do: turn off Journaling , using *Disk Utility.* Select your recording volume in Disk Utility, hold the alt key while dropping down the File menu. Choose *Disable Journaling.*
    On the other hand, it might also point to a RAM issue. Do you ever suffer Kernel panics (=the darkening 'curtain' and the message "You need to restart your Mac... etc")? or 'unexplained' crashes? If not or very rarely, I'ld rule out a RAM issue. If daily, it could be. What you can try in this case is to turn of your Mac and physically take out and reinsert your RAM.
    And when you trash (=eject/unmount), physically disconnect and reconnect your recording disk? Does that help? (Logic should not be running when you do this)

  • What mean "logical end-of-file reached" messaage ? (screen attached)

    I see that when loading project. Is all ok after i press OK but what is that means ?

    Not seeing a picture... are there audio files associated with this project?
    Logical-end-of-file-reached usually refers to a corrupt audio file where the data header file end does not match the actual file length. In other words, the audio file it truncated or the file header describing the file is corrupt.
    It could also be an audio file has been marked "read only" but that is less likely.
    Are you sure all of your audio files are working correctly.

  • Can't save=Error -39 Logical End Of File Reached

    Hi whenever I try to re-save a .jpg file, I get the "Error -39 Logical End Of File Reached."
    I have tryed everything I can think of: Copy/Pasting; Importing, etc. with no success. Any help would be greatly appreciated!
    Thanks.

    DamonGrant wrote:
    Thanks for those suggestions Erik...
    It's been happening for a month I guess and I don't think that anything new's been installed. I will try recording to the start up disc and to maybe to some USB discs I have.
    It seems to happen after working on a project for some time.
    After say tracking takes for 45 mins or so. Maybe it's just coincidence, but do you think that might indicate a hardware issue?
    Now there might be a clue. What happens when you then quit Logic, reboot your Mac, and reopen the active session? It might be that your disk has become a bit messy from all the traffic, and it just needs to 'settle' in OS X again. Click on the *Spotlight icon* top right of your screen and see if any indexing is taking place. Wait for it to finish before launching Logic.
    Alternatively, you could exclude your recording disk from Spotlight indexing alltogether, by dragging the disk to the Privacy field in the Spotlight Sysprefpane.
    One other thing to do: turn off Journaling , using *Disk Utility.* Select your recording volume in Disk Utility, hold the alt key while dropping down the File menu. Choose *Disable Journaling.*
    On the other hand, it might also point to a RAM issue. Do you ever suffer Kernel panics (=the darkening 'curtain' and the message "You need to restart your Mac... etc")? or 'unexplained' crashes? If not or very rarely, I'ld rule out a RAM issue. If daily, it could be. What you can try in this case is to turn of your Mac and physically take out and reinsert your RAM.
    And when you trash (=eject/unmount), physically disconnect and reconnect your recording disk? Does that help? (Logic should not be running when you do this)

  • Opening mp3 file in KM Content w/ Windows media player end of file reached

    Hello all, when I am in KM content, I click on an mp3 file and I get end of file reached w/Windows media player.   If I select the mp3 file and say "Save target as" and download it to my pc I can open it just fine in windows media player.  Also opening the file in km content with Real Audio Player, I get a login prompt to the portal.  When I click cancel the file plays in real audio.  If I enter my login credentials in the real audio prompt the file won't play.  Any ideas anyone?
    thanks in advance
    -- Steve

    I am getting the same problem. I usd YouTube downloader (YTD) to download videos to Music Folder and Then YTD converts them from mp4 Video to mp3 Audio and then adds the audio to the  WMP then when I go to play them theres a few with the blue? with
    the same error but most the rest play fine I cant figure it out  but if you do , please let me know and viceversa  thanks

  • I really need help asap please..i have deadlines.."the end of file reached"

    im currently running logic pro 7 academic on my g5--"the end of file reached" pop up occured (i think it was error code 43) and it said something about preferences i accidently hit the save button and i guess it saved the preferences(since then it has not popped up again)--i cannot hear anything from any of my files--all i am able to is basically look at the arrange window with 4 audio tracks and tracks from my keyboard---when i try to create audio instruments a pop up says "no more tracks available"--ive reloaded both of the logic discs and still am unable to get anything to work

    OK, that's quite a lot in one go...and you have deadlines..let's see if we can clear things up?
    You say you cannot hear anything...Have you ever had output coming out of Logic or is this your first try? If you can't hear anything, how on earth are you recording?
    (I take it the "end of file" message shows up while recording?)
    Are you using an audio interface or running straight out of the G5's internal audio card?
    I've never had that "end of file" message but I suspect it can have something to do with the maximum recording time.
    You set it under the Audio menue/Set Audio Record Path (Apple/A)
    Now, to the Tracks:
    Have you ever run the Set-Up Assistant (Logic Pro menue/Preferences/Logic Set-Up Assistant)? If not, I recommend you do. Here you can set the framework for your Audio Environment, How many tracks, busses etc.
    Sorry if this is too basic for you, i'ts hard to tell how deep in to the application you are.
    Good Luck,
    Erik

  • Help!! Unable to launch Outlook Express - Error says 'end of file reached'

    I double clicked on my icon to launch my email and got this message. I had Outlook Express 5.02 Tried rebooting twice. Backed up 5.02 on simple drive, then downloaded OE 5.06. Getting the same message... Unable to launch, end of file reached. anyone have any idea what is going on?? everything was fine yesterday!!! ps.. I am totally clueless with computers.. so need very specific (you are talking to a dummy) help here. PLEASE!!
    Thanks!!!
    imac   Mac OS 9.0.x  

    Hi, tsam -
    Welcome to Apple's Discussions.
    That error is often returned when one or more of OE's databases gets too full.
    Try compacting the databases in OE. This function is a built-in one, and can be done before the program actually loads. To do that, with OE not running hold down the Option key while opening OE.
    • If you're opening OE directly, hold Option down while double-clicking OE's icon.
    • If you're opening OE via the Mail icon in IE's toolbar, hold down Option while clicking that icon.
    You'll receive a splash message asking if you want to compact the databases - click OK. Once that is done, you can get rid of the old database files (they'll have been renamed to indicate that they are the old ones).
    OE keeps those files in its account (identity) folder(s). If you're not familiar with where those are -
    • Current versions of OE keep them here - (hard drive ) >> Documents >> Microsoft User Data >> Identities >> Main Identity.
    • Older versions of OE kept those in the Identities folder inside the program's folder.
    "Main Identity" is the original default account (identity = account); if you've created additional accounts, there will be a separate folder for each in the Identities folder.
    It would also be advisable to increase the Preferred memory allocation for OE. Adding 20 or 30 thousand to the original amount is not excessive - more is better.
    Article #18278 - Assigning More Memory to an Application
    • Whenever you replace or update a program, you must redo any changes made to its memory allocation amounts - the changes are not carried over to a new or replacement version.
    Also, when you update OE or IE, particularly if you have both the old version and the new version on the drive at the same time, reset the default choices for those in the Internet control panel.

Maybe you are looking for

  • Update belle refresh not present.

    My phone has version 111.030.0609 and  sw and suite give this as up to date. i thought the most recent update is Nokia Belle Refresh (111.040.1511) but i dont't get this one. what is it i do wrong? Solved! Go to Solution.

  • SUM VALUES

    Hi I need to sum values for different CD_INDICATOR, same CD_CUSTOMER , same NM_CYCLE , same CD_STRUT, same PROFILE CD_STRUT                    NUMBER(6)                              NM_CYCLE                    NUMBER(6)                              C

  • Connecting to my work pc

    Having a few problems connecting my ipod video to my work pc as I like to listen as I work ! I had connected it and was working fine then had to completely reset & restore ipod. Now working fine at home etc. Now when I connect ipod to work pc itunes

  • Best place to put the event listener?

    Hey there! I am loading several images using a loop. My question is, would it be better to put the "contentLoaderInfo.addEventListener(Event.COMPLETE..." in the loop so it loads the compelte handler each time it goes through the loop, or is it fine t

  • Automount script on boot up

    i'm trying to get an apple script to function as a login item with auto login on a reboot. If i log out and log into the computer the script runs fine, however on boot it fails. I have it saved as an application with all the check boxes unchecked. al