6 Star 0 Fork 0

clclcl/team

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
music.java 718 Bytes
Copy Edit Raw Blame History
派头子 authored 2018-05-27 22:59 . Upload music.java
import java.applet.AudioClip;
import java.io.*;
import java.applet.Applet;
import java.awt.Frame;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import javax.swing.JFrame;
public class Music extends JFrame{
File f;
URI uri;
URL url;
// Music(){
// bgMusic();
// }
Music(){
try {
f = new File("Taylor Swift-Sparks Fly.wav");
uri = f.toURI();
url = uri.toURL(); //ַ
AudioClip aau;
aau = Applet.newAudioClip(url);
aau.loop(); //ѭ
} catch (Exception e)
{ e.printStackTrace();
}
29 }
30 public static void main(String args[]) {
31 new Music();
32 }
33 }
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/clcl1004/team.git
git@gitee.com:clcl1004/team.git
clcl1004
team
team
master

Search