Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2007, 05:22 AM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
uploading sound file in java
hi there,

i am trying to upload a sound file into my class .
i am using this method
Code:
string strFilename = args[0]; File soundFile = new File(strFilename);
but how do i specify the location of the song i want
for example the song is in the desktop under name (song1.wav)
and what if i want to upload mp3 ?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2007, 04:56 PM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
anyone plzzzzz
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-03-2007, 05:20 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Your problem is not clear. If you clearly describe your situation, someone may hep.. I did not understand your problem. You can just give the path of the file to your File object and it can be the arg[0] of your program as you described.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 11-03-2007, 09:59 PM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
The problem is that i dont know how to give the path of the file i want to upload to arg[0] ...

how do i do that in Eclipse ?
someone told me this "enter the right parameter in argument section of the application configuration window."
does this makes sense to anyone ?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 11-03-2007, 11:21 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Yes it should be sth like that. But i dont use Eclipse. In netbeans, i right click to the project, select project properties, select run parameter tab and set the arguments there.

I found this document for you. If it is not old, it might work:

Help - Eclipse SDK
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 11-03-2007, 11:46 PM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
yes Thank you its very useful , but what arguments do i need to add for my case ?
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 11-03-2007, 11:54 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
The path of the file. (e.g. c:\myfile.txt)

As far as i remember, args[0] was the your application name. So you will use args[1] to access first argument like this:

Code:
java MyApplication c:\myfile.txt args[0] = MyApplication args[1] = c:\myfile.txt
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 11-04-2007, 12:29 AM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
i didnt get what u mean ??

is that what i need to type in the command line ? cuz as u know i am using Eclipse !!

where do i add these lines ?
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 11-04-2007, 01:00 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Yes, that is what you need to type in the command line.

The thing i was describing is about how to get that input within your program.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading a file with Servlet farakhkhan@yahoo.com New To Java 0 03-10-2008 10:02 PM
File Uploading aaliadhurue Advanced Java 4 01-16-2008 08:56 PM
Uploading files to FTP javaplus New To Java 0 12-19-2007 12:08 PM
Make sound play in a java application lenny AWT / Swing 2 08-13-2007 01:45 PM
Sound in applet Java toby Java Applets 1 08-07-2007 07:52 AM


All times are GMT +3. The time now is 11:40 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org