❶ 用java做音視頻播放器
我做過一個MP3的..給你看看.
package music;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import javax.media.bean.playerbean.*; //這個包要用到JMF
public class MP3 extends JFrame implements Runnable {
public JLabel shijian;
private JSlider sldDiameter;
public MediaPlayer soumd1;
public JButton playSound, loopSound, stopsound;
public JButton tjian, shanc, baocun, qu;
public JPanel jp1, jp2, jp3, jp4;
public JList jl;
int zongmiao=0;
public Vector vector, mingcheng;
boolean fo = false, geshi = false;
JLabel jl1, jl2, sj1, sj2;
JTextField jt1, jt2;
JButton queding, xiugai;
int zong = 0;
int a = 0, b = 0, you = 1,mm=0;
int fenzhong, miaozhong;
public MP3() {
super(「java簡單音樂播放器「);
soumd1 = new MediaPlayer();
Container c = getContentPane();
c.setLayout(new FlowLayout());
mingcheng = new Vector();
jp1 = new JPanel();
shijian = new JLabel();
jp1.add(shijian);
c.add(jp1);
playSound = new JButton(「開始播放「);
loopSound = new JButton(「循環播放「);
stopsound = new JButton(「停止播放「);
jp2 = new JPanel();
jp2.add(playSound);
jp2.add(loopSound);
jp2.add(stopsound);
c.add(jp2);
jp4 = new JPanel();
sj1 = new JLabel();
sj2 = new JLabel();
sldDiameter = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 0);
sldDiameter.setMajorTickSpacing(1);
sldDiameter.setPaintTicks(true);
jp4.add(sj1);
jp4.add(sldDiameter);
jp4.add(sj2);
c.add(jp4);
vector = new Vector();
jl = new JList(mingcheng);
jl.setVisibleRowCount(5);
jl.setFixedCellHeight(40);
jl.setFixedCellWidth(265);
jl.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
c.add(new JScrollPane(jl));
tjian = new JButton(「添加「);
shanc = new JButton(「刪除「);
qu = new JButton(「讀取「);
baocun = new JButto
摘選自網上,希望對你有幫助。
❷ 瑙嗛戝備綍杞鍖栨垚java嫻佹枃浠舵斁鍒扮綉欏典腑鎾鏀
璇ラ棶棰樼殑鎿嶄綔鏂規硶濡備笅錛
1銆佽嗛戠紪鐮侊細闇瑕佸皢瑙嗛戞枃浠惰繘琛岀紪鐮侊紝杞鎹㈡垚鍙浠ュ湪緗戦〉涓鎾鏀劇殑鏍煎紡錛屽侻P4銆傝繖涓榪囩▼鍙浠ラ氳繃浣跨敤涓浜涘紑婧愮殑搴擄紝濡俋uggler鏉ュ畬鎴愩俋uggler鍙浠ヨ交鏉懼湴灝嗚嗛戞枃浠剁紪鐮佷負MP4鏍煎紡錛屽悓鏃惰繕鍙浠ュ皢闊抽戜粠瑙嗛戜腑鎻愬彇鍑烘潵銆
2銆佸壋寤篔ava嫻侊細瑙嗛戣緙栫爜涓篗P4鏍煎紡錛屽彲浠ヤ嬌鐢↗ava鐨凢ileInputStream綾繪潵鍒涘緩涓涓杈撳叆嫻侊紝灝嗚嗛戞枃浠剁殑鏁版嵁璇誨彇鍒癑ava紼嬪簭涓銆
3銆佸皢Java嫻佸祵鍏ュ埌緗戦〉涓錛氶渶瑕佸皢Java嫻佸祵鍏ュ埌緗戦〉涓銆傝繖鍙浠ラ氳繃浣跨敤Java鐨刟pplet鏉ュ疄鐜般俛pplet鏄涓縐嶅彲浠ョ敤Java緙栧啓鐨勫㈡埛絝搴旂敤紼嬪簭錛屽彲浠ュ祵鍏ュ埌HTML欏甸潰涓騫跺湪鐢ㄦ埛鐨勬祻瑙堝櫒涓婅繍琛屻傞氳繃灝咼ava嫻佷紶閫掔粰applet錛屽氨鍙浠ュ湪緗戦〉涓婃挱鏀捐嗛戜簡銆