Thanks, I done just that, and the resource file is indeed getting accessed now... however still no music comes out. I find it very strange seeing that the sound file is being accessed, yet still no sound is heard. Is the Windows Media Player supposed to open upon access of the resource file?
thanks a lot,
tiktik...
User Profile
Collapse
-
Thanks a lot,
I've found an example as well an did this program, however there is one problem.
...Code:import java.applet.Applet; import java.applet.AudioClip; import java.net.URL; public class Music_1 { public static void main(String[] args) { try { URL url = new URL("file:Zocalo.wav"); AudioClip ac = Applet.newAudioClip(url);Leave a comment:
-
Embedding music in Java
Hey there,
I was doing a simple program using JCreator where I wanted to embed a song. However I don't know how I can do this, and although I browsed thoroughly through the web, I did not find any examples on how one can embed some music in his program...
Any idea on how I can embed a song from My Documents (or elsewhere) into my program?
Any help would be much appreciated.
Regards,... -
Clearing the screen
Hey there...
I know that Java does not have a specific command which clears the screen, however I was wondering whether there exists some simple commands/coding which would have the same result.
any ideas pls? -
hangman
hi there...
Last year, I did the whole hangman game in Pascal; however it was a little bit different in structure than yours is going to be; in such a way that mine first involved the first player to enter the "Secret_wor d", and then the second player would try to guess it. With regards to the blanks, an int variable "no_of_blan ks" would read the length of the "Secret_wor d" entered...Leave a comment:
-
-
Conditional branching problem
Hi all...
I am compiling this simple program which determines the ticket price for the person, depending on the criteria entered.
My problem is, however, that the answer at the end is always "FREE" (as if the program is not considering the other if branches =(
...Code:System.out.println("Enter your age "); int age = Keyboard.readInt(); System.out.println("Enter -
Thanks for the detailed explanation.
good comic as well =)
tiktikLeave a comment:
-
Yes, thanks for your reply...it works very well with it as well
Any idea about the break; question?Leave a comment:
-
Never mind.... i solved the problem by inserting "System.out.pri ntln" after every if statement like this
...Code:public static void main(String[] args) { System.out.print ("Enter mark: "); int mark = Keyboard.readInt(); char grade =' '; if (mark > 100) System.out.println ("Invalid Entry"); else if (mark >=80 && markLeave a comment:
-
Yes that's it thanks a lot...
but now i have another problem...
i would like that if the entry is invalid, it would not display the last line ("Grade =" ), and so i tried to insert the 'break;' but it seems as if it can be used only in loops or switch :(
...Code:public static void main(String[] args) { System.out.print ("Enter mark: ");Leave a comment:
-
Nested if() statements...Grade range...
Hi...
I am doing this simple Java program which displays a particular grade (A, B, C...) according to the mark entered.
However I cannot arrange it in such a way that it displays "Invalid" if the user eners a grade > 100... take a look...
...Code:System.out.print ("Enter mark: "); int mark = Keyboard.readInt(); char grade =' '; if (mark -
Thanks a lot ... i think i've found it :
int a = (int) (Math.random()* 20) +70;
isn't it?...
(it does work)
thanks again =)...Leave a comment:
-
Generating Random Numbers
Hey,
I had school exercise in which i needed to generate some numbers within the range of 70 to 90. I'd like to know whether there exists an exact formula which allows the numbers to be generated within a particular range.
When I had to generate numbers from 10 to 20, the correct code was :
float a = (float) (Math.random()* 10) +10;
but I can't establish a general rule for all the ranges......
No activity results to display
Show More
Leave a comment: