I have a client. It receives values (a
string) when it connects to a server. The server returns string names of music files that are available. The client then has choices in the JList. If he or she double clicks on one of the names, the client makes a request to the server for music file information. The server then sends the music file information to the client, who then plays it.
This scenario above describes what I want to happen. So far, I've gotten through to the last part. I have it sending and receiving as a string. I need insight on how to send and receive the file. I also need to know how to play it. What I think I have to do is send the music as bytes, receive it as bytes, then convert the bytes to an InputStream. Then, I can play the InputStream. If you could help me do this, that would be awesome. I am receiving the "message" as a String value, so I'm not sure how to receive as bytes and still be able to read as string values (IE : For the "stop" and "FileUpload" commands).
Thanks,
John Price
EDIT: Server and Client code revised below, along with picture and new description of problem.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)