文件名称:javapiano
介绍说明--下载内容均来自于网络,请自行研究使用
Java Piano模拟钢琴效果的完整源码,知识点:使用AudioClip类播放声音,使用Java MouseEvent类处理鼠标事件,使用Image类制作图片,使用fr a me类制作界面框架。运行后创建一个带有模拟钢琴键盘的面板,用户可以通过键盘或者鼠标来“敲击”钢琴键盘发出声音,也可以通过电脑键盘的组合键实现钢琴的高音。
编程思路:首先制作模拟钢琴的实例,生成程序界面:先通过语句Image m_ImgUp生成键盘、鼠标松开时显示的键盘图片,再通过语句Image m_ImgDown生成键盘、鼠标按下时显示的键盘图片,最后通过语句m_ImgUp=getImage(getDocumentBase(),"img/up.gif")和语句m_ImgDown=getImage(getDocumentBase(),"img/down.gif")加载图片,生成钢琴界面。然后模拟钢琴效果,模拟声音的播放,首先通过语句AudioClip[] m_AudioClip=new AudioClip[14]生成一个音频对象的数组,保存七个中音和七个高音的声调,最后,通过函数public void keyPressed(KeyEvent e)来响应按下键盘的动作,实现声音的播放-Complete source Java Piano Piano effects simulation , knowledge: Use AudioClip class to play sounds , using Java MouseEvent class handles mouse events , use the Image class to create an image , using the fr a me class production interface fr a mework. Create a panel with a simulated piano keyboard after running, the user through the keyboard or mouse to " tap " sound piano keyboard , piano treble can also be achieved through a combination of computer keyboard keys .
Programming ideas: first production examples simulate piano generating program interface : first m_ImgUp generated when the keyboard, mouse, keyboard, display pictures by loosening the statement Image, then m_ImgDown generated when the keyboard, mouse, keyboard, display pictures by pressing the statement Image, and finally through statement m_ImgUp = getImage (getDocumentBase (), "img/up.gif") and statements m_ImgDown = getImage (getDocumentBase (), "img/down.gif") load images , generate piano interface. Then the effect of sim
编程思路:首先制作模拟钢琴的实例,生成程序界面:先通过语句Image m_ImgUp生成键盘、鼠标松开时显示的键盘图片,再通过语句Image m_ImgDown生成键盘、鼠标按下时显示的键盘图片,最后通过语句m_ImgUp=getImage(getDocumentBase(),"img/up.gif")和语句m_ImgDown=getImage(getDocumentBase(),"img/down.gif")加载图片,生成钢琴界面。然后模拟钢琴效果,模拟声音的播放,首先通过语句AudioClip[] m_AudioClip=new AudioClip[14]生成一个音频对象的数组,保存七个中音和七个高音的声调,最后,通过函数public void keyPressed(KeyEvent e)来响应按下键盘的动作,实现声音的播放-Complete source Java Piano Piano effects simulation , knowledge: Use AudioClip class to play sounds , using Java MouseEvent class handles mouse events , use the Image class to create an image , using the fr a me class production interface fr a mework. Create a panel with a simulated piano keyboard after running, the user through the keyboard or mouse to " tap " sound piano keyboard , piano treble can also be achieved through a combination of computer keyboard keys .
Programming ideas: first production examples simulate piano generating program interface : first m_ImgUp generated when the keyboard, mouse, keyboard, display pictures by loosening the statement Image, then m_ImgDown generated when the keyboard, mouse, keyboard, display pictures by pressing the statement Image, and finally through statement m_ImgUp = getImage (getDocumentBase (), "img/up.gif") and statements m_ImgDown = getImage (getDocumentBase (), "img/down.gif") load images , generate piano interface. Then the effect of sim
(系统自动生成,下载前可以参看下载内容)
下载文件列表
模拟钢琴\AU\0.AU
........\..\1.AU
........\..\10.AU
........\..\11.AU
........\..\12.AU
........\..\13.AU
........\..\14.AU
........\..\2.AU
........\..\3.AU
........\..\4.AU
........\..\5.AU
........\..\6.AU
........\..\7.AU
........\..\8.AU
........\..\9.AU
........\..\_desktop.ini
........\IMG\DOWN.GIF
........\...\Thumbs.db
........\...\UP.GIF
........\...\_desktop.ini
........\Java模拟钢琴.doc
........\Piano.class
........\Piano.html
........\Piano.java
........\_desktop.ini
........\AU
........\IMG
模拟钢琴