🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
1 messages
1 total messages Started by ���ܵ�Сʨ Thu, 07 May 1998 00:00
��Java Application�������
#848
Author: ���ܵ�Сʨ
Date: Thu, 07 May 1998 00:00
52 lines
3889 bytes
   ��ǰ,�кܶ����½��������JavaС����(Applet)�в������ֹ���
�����ҳ�������,���������Ӧ�ó���(Application)�в������ֵ�
���ܻ�����,���ļ�Ҫ�������ʵ����һ���ܡ�
    Sun��ǰ��Java Development Kit�汾1.1.3������ʽ֧����Appl
ication�в��������ļ�,����Ȼ����ͨ��������ʵ����һ���ܡ�
���Ƚ���һ����Applet�в������ֵ��ĸ�����,��������:
     import java.applet.*;
     AudioClip ac=getAudioClip (getCodeBase(), File);
     //����Audioclip����װ��.au�ļ�
     ac.play();        //����һ��
     ac.stop();        //ֹͣ����
     ac.loop();        //ѭ������
    �˴�����Application�б���ʱ�ᷢ�����,��ΪAudioClip����(
object)��getAudioCi p()����(method)������java.applet��,����
��Application���޷����á�
    �������İ취��ʹ��һЩSun��JDK�з�����δ��ʽע�����ص�
����Winzip��Zip�۲�һ��class.zip�ļ��ͻᷢ��,����java.applet
���а�������ļ�������,��/sun/audioĿ¼�µ�sun.audio��Ҳ��
�����Ƶķ����������Ǵ����ע��:
     import sun.audio.*;
     //����sun.audio��
     import java.io.*;
     InputStream in = new FileInputStream (Filename);
     //��һ�������ļ�����Ϊ����
     AudioStream as = new AudioStream (in);
     //������������һ��AudioStream����
     AudioPlayer.player.start (as);
     //"player"��AudioPlayer��һ��̬��Ա���ڿ��Ʋ���
     AudioPlayer.player.stop (as);
     ��������������ļ�����ʱ,�����´���������ļ���ַ:
     AudioStream as = new AudioStream (url.openStream());
     ����һ�����������������һЩ,������������������������
;Ȼ��������´���:
     AudioData data = as.getData   (); //����AudioDataԴ
     ContinuousAudioDataStream cas = new ContinuousAudioData
Stream (data);
     AudioPlayer.player.play (cas);      //����
     AudioPlayer.player.stop (cas);      //ֹͣ
    ��Ϊ���ϳ���ʹ����δ����������,���Բ��ܱ�֤���ڵ�ǰSun J
DK����ı����������С�(���ٷ�)
    ע:���ĸ���������ϱ����ɡ�

--
 ________ _____          _____        ______________  _____ 
 ___  __ \___(_)________ ___(_)       __  ___/___  /_ ___(_)
 __  /_/ /__  / ___  __ \__  /        _____ \ __  __ \__  / 
 _  ____/ _  /  __  /_/ /_  /         ____/ / _  / / /_  /  
 /_/      /_/   _  .___/ /_/          /____/  /_/ /_/ /_/   
                /_/                                         

�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: hsia.nju.edu.cn]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads