Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 cant get music to play properly in java (never mind i figured it out)
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Monduman11




PostPosted: Sun Jun 19, 2011 7:23 pm   Post subject: cant get music to play properly in java (never mind i figured it out)

code:

public class MyListener implements ActionListener
    {
        public void actionPerformed (ActionEvent ae)
        {
            if (ae.getSource () == b1)
            {
                Sound testsong = new Sound ("armory.wav");
                testsong.playSound ();
                startstring = "first was pressed";
                repaint ();

            }

            else if (ae.getSource () == b2)
            {
                Sound testsong = new Sound ("chaoz.wav");
                testsong.playSound ();
                startstring = "2 was pressed";
                repaint ();
            }
            if (ae.getSource () == b3)
            {
                Sound testsong = new Sound ("disco.wav");
                testsong.playSound ();
                startstring = "3 was pressed";
                repaint ();
            }
            else if (ae.getSource () == b4)
            {
                Sound testsong = new Sound ("envy.wav");
                testsong.playSound ();
                startstring = "4 was pressed";
                repaint ();
            }
            if (ae.getSource () == b5)
            {
                Sound testsong = new Sound ("fire aura.wav");
                testsong.playSound ();
                startstring = "5 was pressed";
                repaint ();
            }
            else if (ae.getSource () == b6)
            {
                Sound testsong = new Sound ("tech.wav");
                testsong.playSound ();
                startstring = "6 was pressed";
                repaint ();
            }
            if (ae.getSource () == stop)
            {
                Sound testsong = new Sound ("tech.wav");
                testsong.stopSound ();
                startstring = "stop was pressed";
                repaint ();
            }

what im trying to get is when i press the button for it to play the song and what happens is the first 2 songs that i click on work but then it stops working,, the start string i added to see if the buttons were still functioning and they are it displays on the screen the correct button is being pressed even after it stops playing the music, how can i make it so it plays all of my songs. for the whole code pm me
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: