Scanner cant find the text file??

Hello guys,
I have a java program that is designed to generate maze out of text files. So basically it takes a text file and uses the info to set up a maze through GUI. The program was written by my professor and i cant get it to run the text files. When i run the program a gui pops up and assks me to enter one of eight text files.
They are labeled maze1.txt to maze8.txt
So once i enter the file, the programs tells me that the files can not be found. I have all eight maze files saved in the source folder. So i assume i dont have to import anything. If it helps any here is how the project set up looks like in eclipse? I have to assume that i have not set up something correctly as the program should work.
Here is the pic of my eclipse setup:
[http://img.photobucket.com/albums/v395/merlin77/maze.jpg]
What am i doing wrong?
Thanks for your help,
Edited by: Lovac on Oct 8, 2008 10:05 PM

Sorry i should have provided more information. Here is how his constructor for Maze class looks like:
     public Maze(String fname) throws FileNotFoundException {
          Scanner sc = new Scanner(new File(fname));
          int r, c;
          r = sc.nextInt();
          c = sc.nextInt();
          m = new int[r + 2][c + 2];
          for (int j = 0; j < c + 2; j++) {
               m[0][j] = -1;
               m[r + 1][j] = -1;
          for (int i = 0; i < r + 2; i++) {
               m[0] = -1;
               m[i][c + 1] = -1;
          for (int i = 1; i <= r; i++) {
               for (int j = 1; j <= c; j++) {
                    m[i][j] = sc.nextInt();
          sc.close();
As you can see above the text file is just passed to constructor as a parameter, and i am thinking when i run the program and it asks me for the text file, i just give it the file name ex. "maze1.txt" and that would be the parameter to the Maze constructor. BUT then the constructor fails to find the file and from what i know that is due to files eather not being imported in the java class or because they are missing from the source folder?
But clearly i have them in the source folder, so importing them in java class would be pointless. The compiler should be able to find them in the source folder.
I guess i can forward this question to Professor, but i thought there was something simple that i am missing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Forefox won't start in windows XP: I get the message that windows "cant' find the exe file" even when I click from the program file, rather than the shortcut.

    Forefox won't start in windows XP: I get the message that windows "cant' find the exe file" even when I click from the program file, rather than the shortcut.

    Delete the current Firefox shortcut on the desktop and create a new desktop shortcut via the right-click context menu on the Firefox.exe program (Send to > Desktop)

  • MS access cant find the database file ....

    I have an issue with just one user on network where only one computer cannot access an access database and the error is "ms access can't find the database file...."
    Sometimes I can remap and get it to load, but on reboot I always get the same bad message. The other computers login as different users and access from xp based pcs through office 2007. The user in question's permissions are not the issue. So could it be that she is using a 2013 version of office from a windows 8 machine? And how fix?
    Jay
    This topic first appeared in the Spiceworks Community

    i m calling the servlet from this JSP and the code
    for it is
    <form action="/myPackage/ConnectionToDatabase"
    method="post">
    the value of the action attribute should correspond to whatever you have included in your url-mapping element as stated in the reply by jcalambra...
    there is no need for you to have /mypackage/ConnectionToDatabase...
    if <url mapping>/Servlet</url=mapping>
    then in your form, you should only have
    <form action="/Servlet" as opposed to...
    form action="/myPackage/ConnectionToDatabase"
    i think thats where the problem resides.. the web.xml needs to be properly configured and the form attributes changed to reflect the new values...
    hope this helps

  • Trying to upgrade itunes says it cant find the source file for bonjour or quicktime. so it won't update. any help?

    Trying to upgrade itunes. it says it needs the source file to upgrade bonjour and quicktime. I downloaded itunes from a website originally. So therefore, i do not have a "source file" now i try to open itunes and i get a message that says something like "action only valid for installed software. Any ideas? oh ya, and i tried to delete itunes and bonjour and quicktime to start all over but it also said it needs the source files.

    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center on June 25. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. (The results from mydigitallife and Major Geeks are worth checking.)
    After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes, QuickTime and Bonjour entries and click "Remove".
    Restart the PC, and try another iTunes install. Does it go through properly this time?

  • I cant find the "text to speech" button in firefox/win8

    when I highlight some text in the browser.

    ''duplicate - locking - https://support.mozilla.org/en-US/questions/1010783''

  • I cant find the "text to voice" button in firefox/win8

    oops, not speakit but text to voice

    Thank you for your question:
    I did find a Hear Text Aloud Narrator for Windows 8
    *[http://windows.microsoft.com/en-us/windows/hear-text-read-aloud-narrator#1TC=windows-8]?
    There is no built in text to voice unfortunately in Firefox, but there is an add on called [https://addons.mozilla.org/en-US/firefox/addon/text-to-voice/?src=search Text to Voice]

  • CANT FIND THE TRACK/FILE TABS?

    Hey im trying to make remix's and i need to edit the audio, but for some reason i dont have the Track and file tabs where it should be? ive tried different audio samples and when i double click the audio, still no Track/File- PLEASE HELP

    If the file is an mp3, convert it to aiff and then try.

  • When syncing with itunes, says that it can't find the required file for syncing with iphoto

    when i sync my iphone to itunes, when it comes to the part of syncing the photos from iphoto
    it says that it cant find the required file. so when i tick off the sync with iphoto and i sync again with itunes, it doesn't give this problem
    so it has to do with the sync with iphoto
    can somebody help me plz?

    Delete the iPod photo cache, as described here:
    http://support.apple.com/kb/ts1314

  • I have photoshop C6 on my MAC Pro and want to install it on my new MAC desktop.  I sent the files with AirDrop but photoshop wont open I get an error message that it cant find the Library.  Any thoughts?

    I have photoshop C6 on my MAC Pro and want to install it on my new MAC desktop.  I sent the files with AirDrop but photoshop wont open I get an error message that it cant find the Library.  Any thoughts?

    download the installation files and install using your serial number or adobe id,
    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5.5 (win), 5.5 (mac) | 5.4 (win), 5.4 (mac) | 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • I downloaded a .zip file. It ate up my space and i cant find the file. How do i get this file off my phone?

    I downloaded a .zip file. It ate up my space and i cant find the file. How can i get this file off my phone?

    Not possible. Safari won't download and save a Zip file. You either had to use a 3rd party app, or as wjosten suggests, your phone is jailbroken. If the former, you'll need to use that app to find it. If the latter, you'll have to look elsewhere for assistance.

  • How do i restore missing files for i work 09 as it is asking me to reinstall but cant find the disk?

    how do i restore missing files for i work 09 as it is asking me to reinstall but cant find the disk?

    Hello Jessica472,
    It sounds like you need to recover some missing files but do not have access to the iWork '09 disc you used to install it. If you have a Time Machine backup and know what files you need, you can use the "Restoring specific files or folders" section of the following article to restore them:
    Mac Basics: Time Machine backs up your Mac
    If you do not have Time Machine, you will need the disc to reinstall the software suite.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • I can't get my music to play in my itunes. It comes with a exclamation mark next to the song numbers and says that the original songs can't be played cause cant find the file. How do I get the songs back? (I found the files)

    I can't get my music to play in my itunes. It comes with a exclamation mark next to the song numbers and says that the original songs can't be played cause cant find the file. How do I get the songs back? (I found the files

    You get exclamation marks or dead tracks because  iTunes can’t find the file. This can happen for a number of reasons:
    The song file or a folder in its path was renamed
    The song file or the folder it is in has been moved
    The song file has been deleted
    The device containing the song files e.g. external drive is not accessible or the drive letter has changed.
    If you use an external drive, a change in drive letter is a common cause and you need to change it back.
    AS a way of working out what has happened, right click on a track and select the summary tab (you will have to go past an error message). The summary tab will tell you where iTunes thinks the track is located. How does that compare with where the track actually is?
    The xml library file is not used by iTunes, it is created to allow other programs to access the library. You can recreate the iTl file from the xml file, but there is no point if the location of the files is wrong.
    There is a simple way of getting you music back in iTunes, but it loses all playlists counts and rating. To do this drag iTunes library.itl and iTunes Library.xml to your desktop. Then open iTunes and an empty library is created. Add you iTunes Media folder to it.
    If you can't work out what went wrong and how to fix it, you may have to do this.

  • Browser can't find a text file opened via the save as dialogue box

    Hi there,
    I have a servlet which outputs a file using the servlet output stream, with the following lines set:
    response.setContentType("application/msword");
    response.setHeader("Content-Disposition", "attachement; filename="+ fileName);
    servletOutStream.write(myBytes);
    servletOutStream.flush();
    It works fine for .doc files and it seems the mechanism is that it is saved to the Temporary Internet Folder and delivered from there when the user clicks on the 'open' or 'save' option in the browser popup dialogue box. However... when I try this with text files, (setting the content type to "text/plain") I get the open/save dialogue box up correctly but if I try to open the file it says it cannot find the file, and gives the path under the Temporary Interenet Folder. If I look in there the text file isn't present - though the .doc files are.
    So... it looks as if the problem is that for some reason it doesn't save the text files correctly to the Temporary Internet Folder.
    I can't deliver the text files inline as a solution as the filename is lost and it thinks it's an html file (which the client doesn't want).
    Any ideas?
    Alison

    At least also set the content length. Your browser may be configured be the default application to open textfiles. If the contentlength is not set, then most applications would refuse to open the file without choosing for 'Save' first and manually open it.

  • In my library it said that most of my music it cant find the files

    my library says most of my songs cant find the files

    same here. itunes "cannot find file" i've tried everything I can think of. HELP

  • Cant find the file for approval

    Hi Guys,
    I have selected service application tool package for download.it requires approval which is to be done in MOPZ.
    When i login to our solman i cant find the file for approval in MOPZ.
    steps that i follow
    1. Tcode DSWP.
    2 go to change mdmt
    3 select Maintanence optimize.
    I cant find the file to approve.
    Do i need to create  a new maintaince tcode...?
    Please help

    Hello,
    Please make sure that the S user password is not in initial state. Please also make sure that you can login with no issues in the SAP Service Marketplace , and that the 'authorization test' for SAP-OSS  works OK.
    I am not sure about when you report the error message as: "Logon information is not write." . What do you mean?
    Also, you say that you go to DSWP and the file is not there to approve. The correct way to approve files from Maintenance Optimizer when downloading manually, is to create the Maintenance Optimizer document, then choose the manual selection option, then select the files from within Maintenance Optimizer, and then proceed with the download from Maintenance Optimizer.
    Best regards,
    Miguel Ariñ

Maybe you are looking for

  • RHCDOC_DISPLAY / Change Document for Position

    Hi Is there any non-custom-ABAP way we could make this report pull in the person (holder) associated with position in the Summary report view, when displaying the most recent change (OLD IC% and NEW IC%)  on a position? For example, running this repo

  • Search Help for Business Partners in tcode UKM_BP

    Hi all, In tcode UKM_BP or UDM_BP, I have to create a new search help for the business partner field. Can anyone help me with this? Should I create my search help in collective search help BUPA? Or is there a better way to to this? Thanks in advance!

  • One-time customer with ERP Sales Order

    Hello experts, I am working with ERP Sales Order on SAP CRM 7.0 Ehp3. We have a requirement to start using 'one-time customer' process. I know there is a standard account groupd (CPD) on ECC side for this purporse. We would like to enter a sales orde

  • Please help! Blue screen, no issues

    Hi all! I have a really big problem. When I start my computer, there is the white screen with the apple,then I have to write my password. That's normal. Ok. After writting my password, the computer goes slower than normaly, to put me in front of a re

  • I need help on iTunes libraries

    I wanted to rename my iTunes library and did the whole 'hold down shift button' think and created a new library. I couldn't be bothered with adding everything back in again and decided to keep my old library, but when it came to it, i couldn't find t