Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

how to open external files ?

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm doing this project as my school assignment. I've done as much as I can for all the source codes part without having tested because I'm having problems to open and access Mxx.mp3 files. I'm using NetBeans and I put all the files under "music" folder and put that folder into "src" folder under the NetBeans project directory.
When I compile, it just keep saying "the file path is undefined" (or something similar to this meaning). I've tested it with prepending "./" + filename but still cannot.

Can someone help me, please ?

thanks in advance
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi could you provide some additional info :
1.Whether the project is a web application deployed on the server or a standalone java apllication
2.In case of it being a web application ,the directory structure of the application , present in the server where it is deployed.
 
Phone Myat Kyaw
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abhijit Rai wrote:Hi could you provide some additional info :
1.Whether the project is a web application deployed on the server or a standalone java apllication
2.In case of it being a web application ,the directory structure of the application , present in the server where it is deployed.



Sorry for being delayed.
1. It's stand alone Java application. Hence, the file structure is simple and as usual of a NetBeans Project.

I put all MXX.wav files under "measures" folder and put that folder under "src" folder. When I compile, got this error message (compilation is successful but cannot run)

"java.io.FileNotFoundException: ..\measures\M96.wav (The system cannot find the path specified)"

This is my method adding the file names into an arraylist.



I've tried without ".." (current directory), but still cannot.

To be able to play, I'm provided a file called StdAudio.class which will read and play the files from the arraylist. I don't have to do anything except building the filenames and calling them properly.

Can someone enlighten me how-to ? If you wish to try and help my case, feel free to ask for the whole files(source codes).

please, appreciate your help !!!
 
Marshal
Posts: 74627
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Current directory" isn't .. but . The .. means one directory up the hierarchy.
 
Phone Myat Kyaw
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:"Current directory" isn't .. but . The .. means one directory up the hierarchy.



uh ok ! I'll try again when I get back home...thanks !
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic