❶ 用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锛屽氨鍙浠ュ湪缃戦〉涓婃挱鏀捐嗛戜简銆