بيانو paino بلغة الجافا


 بيانو paino بلغة الجافا
                           



package panio;



    import sun.audio.*;

    import java.io.*;

import javax.swing.JOptionPane;





//button A

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) 

{                                         

        InputStream iAudio;

        

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\A.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//buton C



    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) 

{                                         

        // TODO add your handling code here: InputStream iAudio;

           InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\C.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//button D

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)

 {                                         

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\D.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//button E

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) 

{                                         

        InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\E.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//button F

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) 

{                                         

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\F.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//buttonG

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) 

{                                         

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\G.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//button B

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) 

{                                         

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\B.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//button C1

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt)

 {                                         

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\C1.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//button E1

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) 

{                                         

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\E1.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                        





//button F1

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) 

{                                          

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\F1.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                         





//button C_s

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {                                          

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\C_s.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                         





//buuton D_s

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) 

{                                          

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\D_s.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                         





//button F_s

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) 

{                                          

       

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\F_s.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                         





//button G_s

    private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) 

{                                          

       

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\G_s.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                         





//button Bb

    private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) 

{                                          

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\Bb.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                         





//button C_s1

    private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) 

{                                          

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\C_s1.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    }                                         





//button D_s1

    private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) 

{                                          

        

          InputStream iAudio;

        try

        {

          iAudio = new FileInputStream("E:\\java\\جافا\\Music_Note\\D_s1.wav");

          AudioStream IMusice =  new AudioStream(iAudio);

          AudioPlayer.player.start(IMusice);

        }

        catch(Exception e)

        {

          JOptionPane.showMessageDialog(null, e);

        }

    } 

تحميل المشروع  http://cut-win.com/NW9j
تحميل ملف الموسيقى http://cut-win.com/a3Q




ليست هناك تعليقات:

يتم التشغيل بواسطة Blogger.