日历记事本程序代码
运行界面:
// CalendarWindow类
package others;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.awt.SplashScreen;
public class CalendarWindow extends JFrame implements
ActionListener,MouseListener,FocusListener {
Calendar calendar;
int year,month,day;
CalendarMessage calendarMessage;
CalendarPad calendarPad;
NotePad notePad;
JTextField showYear,showMonth;
JTextField showDay[];
CalendarImage calendarImage;
String picturename;//图像名称;
String getPicture_address;
Alarm alarm;
JButton nextYear,previousYear,nextMonth,previousMonth;
JButton saveDailyRecord,deleteDailyRecord,readDailyRecord,changeBackground;
File dir;
Color backColor=Color.white;
public CalendarWindow()
{
dir= new File("./dailyRecord");
dir.mkdir();
showDay = new JTextField[42];
for(int i=0;i<showDay.length;i++)
{
showDay[i]=new JTextField();
showDay[i].setBackground(backColor);
showDay[i].setLayout(new GridLayout(3,3));
showDay[i].addMouseListener(this);
showDay[i].addFocusListener(this); } calendarMessage = new CalendarMessage(); calendarPad = new CalendarPad(); notePad = new NotePad(); Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); year = calendar.get(Calendar.YEAR); month = calendar.get(Calendar.MONTH)+1; day = calendar.get(Calendar.DAY_OF_MONTH); calendarMessage.setYear(year); calendarMessage.setMonth(month); calendarMessage.setDay(day); calendarPad.setCalendarMessage(calendarMessage); calendarPad.setShowDayTextField(showDay); notePad.setMessage(year,month,day); calendarPad.showMonthCalendar(); doMark(); calendarImage = new CalendarImage(); picturename=getPicture_address();// calendarImage.setImageFile(new File(picturename)); alarm=new Alarm();
JSplitPane splitV1 = new
JSplitPane(JSplitPane.VERTICAL_SPLIT,calendarPad,calendarImage);
JSplitPane splitV2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT,notePad,alarm); JSplitPane splitH = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,splitV1,splitV2); add(splitH,BorderLayout.CENTER);
showYear = new JTextField(""+year,6);
showYear.setFont(new Font("TimesRoman",Font.BOLD,12));
showYear.setHorizontalAlignment(JTextField.CENTER);
showMonth = new JTextField(""+month,4);
showMonth.setFont(new Font("TimesRoman",Font.BOLD,12));
showMonth.setHorizontalAlignment(JTextField.CENTER);
nextYear = new JButton("下年");
previousYear = new JButton("上年");
nextMonth = new JButton("下月");
previousMonth = new JButton("上月");
nextYear.addActionListener(this);
previousYear.addActionListener(this);
nextMonth.addActionListener(this);
previousMonth.addActionListener(this);
showYear.addActionListener(this);
showMonth.addActionListener(this);
JPanel north = new JPanel();
north.add(previousYear);
north.add(showYear);
north.add(nextYear);
north.add(previousMonth);
north.add(showMonth);
north.add(nextMonth);
add(north,BorderLayout.NORTH);
changeBackground = new JButton("更改背景图片");
saveDailyRecord = new JButton("保存日志");
deleteDailyRecord = new JButton("删除日志");
readDailyRecord = new JButton("读取日志");
changeBackground.addActionListener(this);
saveDailyRecord.addActionListener(this);
deleteDailyRecord.addActionListener(this);
readDailyRecord.addActionListener(this);
JPanel pSouth = new JPanel();
pSouth.add(changeBackground);
pSouth.add(saveDailyRecord);
pSouth.add(deleteDailyRecord);
pSouth.add(readDailyRecord);
add(pSouth,BorderLayout.SOUTH);
setVisible(true);
setBounds(70,70,770,500);
validate();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public String getPicture_address()
{
String address=null;
try
{
FileInputStream outOne=new FileInputStream("picture_address.txt");
ObjectInputStream outTwo=new ObjectInputStream(outOne);
try{address=(String)outTwo.readObject();}
catch(Exception ex){}
outTwo.close();
}
catch(IOException eee)
{
}
if(address!=null)
{
return address;
}
else
{
return "picture.jpg";
}
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==changeBackground)
{
FileDialog dia=new FileDialog(this,"选定图片",FileDialog.LOAD);//新建一个文
件选择对话框,用dia获得选择得到的信息;
dia.setModal(true);//设置为模态对话框;
dia.setVisible(true);
if((dia.getDirectory()!=null)&&(dia.getFile()!=null))//如果得到的路径和文件名不为
空;
{
try
{
FileOutputStream inOne=new FileOutputStream("picture_address.txt");
ObjectOutputStream inTwo=new ObjectOutputStream(inOne);
inTwo.writeObject(dia.getDirectory()+dia.getFile());
inTwo.close();
}
catch(IOException ee)
{
}
picturename=getPicture_address();//从文件中读出显示图片的路径地址;
calendarImage.setImageFile(new File(picturename));//将获得路径传给图片,显示该路径指定
的图片
} } if(e.getSource()==nextYear) { year++; showYear.setText(""+year); calendarMessage.setYear(year); calendarPad.setCalendarMessage(calendarMessage); calendarPad.setShowDayTextField(showDay); calendarPad.showMonthCalendar(); notePad.setMessage(year,month,day); doMark(); } else if (e.getSource()==previousYear)
{ year--; showYear.setText(""+year); calendarMessage.setYear(year); calendarPad.setCalendarMessage(calendarMessage);
calendarPad.setShowDayTextField(showDay); calendarPad.showMonthCalendar();
notePad.setMessage(year,month,day); doMark(); } else if (e.getSource()==nextMonth) { month++; if(month>12) { month=1; year++; }
showYear.setText(""+year); showMonth.setText(""+month); calendarMessage.setMonth(month); calendarPad.setCalendarMessage(calendarMessage); calendarPad.setShowDayTextField(showDay); calendarPad.showMonthCalendar(); notePad.setMessage(year,month,day); doMark(); } else if (e.getSource()==previousMonth) { month--; if(month<1) { month=12; year--; }
showYear.setText(""+year); showMonth.setText(""+month); calendarMessage.setMonth(month); calendarPad.setCalendarMessage(calendarMessage); calendarPad.setShowDayTextField(showDay); calendarPad.showMonthCalendar(); notePad.setMessage(year,month,day); doMark(); }
else if (e.getSource()==showYear) { String s = showYear.getText().trim(); char a[] = s.toCharArray(); boolean boo = false; for(int i = 0;i < a.length;i++) { if(!(Character.isDigit(a[i]))) boo = true; } if(boo==true)
JOptionPane.showMessageDialog(this,"你输入了非法年份","警告~", JOptionPane.WARNING_MESSAGE); else if(boo==false) year = Integer.parseInt(s); showYear.setText(""+year); calendarMessage.setYear(year);
calendarPad.setCalendarMessage(calendarMessage); calendarPad.showMonthCalendar(); notePad.setMessage(year,month,day); doMark(); } else if(e.getSource()==showMonth) { String s = showMonth.getText().trim(); char a[] = s.toCharArray(); boolean boo = false; for(int i = 0;i < a.length;i++) { if(!(Character.isDigit(a[i]))) boo = true; } if(boo==true) JOptionPane.showMessageDialog(this,"你输入了非法月份","
警告~", JOptionPane.WARNING_MESSAGE); else if(boo==false) month = Integer.parseInt(s); showMonth.setText(""+month); calendarMessage.setYear(month); calendarPad.setCalendarMessage(calendarMessage); calendarPad.showMonthCalendar(); notePad.setMessage(year,month,day); doMark(); } else if (e.getSource()== saveDailyRecord) { notePad.savefile(dir,year,month,day); doMark(); } else if(e.getSource()==deleteDailyRecord) { notePad.deletefile(dir,year,month,day); doMark(); } else if (e.getSource()==readDailyRecord) { notePad.readfile(dir,year,month,day);
} } doMark(); public void mousePressed(MouseEvent e) { JTextField text = (JTextField)e.getSource(); String str = text.getText().trim(); try { day = Integer.parseInt(str); } catch (NumberFormatException exp) {}
calendarMessage.setDay(day); notePad.setMessage(year,month,day); } public void mouseReleased(MouseEvent e){} public void mouseEntered(MouseEvent e){} public void mouseExited(MouseEvent e){} public void mouseClicked(MouseEvent e){} public void focusGained(FocusEvent e) { Component com = (Component)e.getSource(); com.setBackground(Color.blue); } public void focusLost(FocusEvent e) { Component com = (Component)e.getSource(); com.setBackground(backColor); } public void doMark() { for(int i=0;i<showDay.length;i++) { showDay[i].removeAll(); String str = showDay[i].getText().trim(); try { int n = Integer.parseInt(str);
if(isHaveDailyRecord(n)==true) { JLabel mess = new JLabel("yes");
mess.setFont(new Font("TimesRoman",Font.PLAIN,11));
mess.setForeground(Color.red); showDay[i].add(mess); showDay[i].setBackground(Color.pink); } if(n==calendar.get(Calendar.DAY_OF_MONTH)) { showDay[i].setFont(new
Font("微软雅黑",Font.ITALIC,23)); //showDay[i].setBackground(Color.DARK_GRAY); showDay[i].setForeground(Color.red); } } catch (Exception exp){} }
calendarPad.repaint();
calendarPad.validate();
}
public boolean isHaveDailyRecord(int n)
{
String key = ""+year+""+month+""+n;
String []dayFile = dir.list();
boolean boo = false;
for(int k = 0;k<dayFile.length;k++)
{
if(dayFile[k].equals(key+".txt"))
{
boo = true;
break;
}
}
return boo;
}
public static void main(String args[])
{
new CalendarWindow();
}
}
//calendarPad类
package others;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class CalendarPad extends JPanel{
int year,month,day;
CalendarMessage calendarMessage;
JTextField []showDay;
JLabel title [];
String [] week={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"}; JPanel north,center;
public CalendarPad(){
setLayout(new BorderLayout());
north=new JPanel();
north.setLayout(new GridLayout(1,7));
center=new JPanel();
center.setLayout(new GridLayout(6,7));
add(center,BorderLayout.CENTER);
add(north,BorderLayout.NORTH);
title=new JLabel[7];
for(int j=0;j<7;j++){
title[j]=new JLabel();
title[j].setFont(new Font("TimesRoman",Font.BOLD,12));
title[j].setText(week[j]);
title[j].setHorizontalAlignment(JLabel.CENTER);
title[j].setBorder(BorderFactory.createRaisedBevelBorder()); north.add(title[j]);
}
title[0].setForeground(Color.red);
title[6].setForeground(Color.blue);
}
public void setShowDayTextField(JTextField [] text){
showDay=text;
for(int i=0;i<showDay.length;i++){
showDay[i].setFont(new Font("TimesRoman",Font.BOLD,15));
showDay[i].setBackground(Color.WHITE);
showDay[i].setHorizontalAlignment(JTextField.CENTER);
showDay[i].setEditable(false);
center.add(showDay[i]);
}
}
public void setCalendarMessage(CalendarMessage calendarMessage){
this.calendarMessage=calendarMessage;
}
public void showMonthCalendar(){
String [] a=calendarMessage.getMonthCalendar();
for(int i=0;i<42;i++)
{
showDay[i].setText(a[i]);
}
validate();
}
}
//NotePad类
package others;
import java.awt.*;
import javax.swing.*;
import java.io.*;
import java.awt.event.*;
class NotePad extends JPanel implements ActionListener,ItemListener {
JTextField ShowMessage;
JTextArea text;
JLabel l1;
JPanel p1,p2,p3;
Choice fontlist,sizelist;
JButton changecolor;
String
Size[]={"10","12","14","16","18",&q
uot;20","22","24","26","28","30&quo
t;};
NotePad()
{
ShowMessage=new JTextField();
ShowMessage.setEditable(false);
text=new JTextArea(10,20);
p1=new JPanel();
p2=new JPanel();
p3=new JPanel();
l1=new JLabel("记事本字体");
changecolor=new JButton("颜色");
fontlist=new Choice();
sizelist=new Choice();
GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment(); String
fontname[]=ge.getAvailableFontFamilyNames();
for(int i=0;i<fontname.length;i++)
{
fontlist.add(fontname[i]);
}
for(int i=0;i<Size.length;i++)
{
sizelist.add(Size[i]);
} p1.add(l1); p1.add(fontlist); p1.add(sizelist); p1.add(changecolor); setLayout(new
BorderLayout()); add(ShowMessage,BorderLayout.NORTH); p2.setLayout(new BorderLayout()); p2.add(new JScrollPane(text),BorderLayout.CENTER); p2.add(p3,BorderLayout.SOUTH); add(p2,BorderLayout.CENTER); add(p1,BorderLayout.SOUTH); setBounds(0,0,400,400); setVisible(true); changecolor.addActionListener(this); fontlist.addItemListener(this); sizelist.addItemListener(this); } public void setMessage(int year,int month,int day) { ShowMessage.setText(year+"年"+month+"月"+day+"日
"); ShowMessage.setHorizontalAlignment(JLabel.CENTER); ShowMessage.setForeground(Color.blue); ShowMessage.setFont(new Font("宋体
",Font.BOLD,15)); text.setText(""); } public void actionPerformed(ActionEvent e) { if(e.getSource()==changecolor) { Color newColor=JColorChooser.showDialog(this, "选择颜色", text.getForeground());
if(newColor!=null) { text.setForeground(newColor); } } } public void itemStateChanged(ItemEvent e) { String n1=sizelist.getSelectedItem(); String name=fontlist.getSelectedItem(); int n2=Integer.parseInt(n1); Font f=new Font(name,Font.PLAIN,n2); text.setFont(f); } public void savefile(File dir,int year,int month,int day) { String dailyRecord=text.getText(); String fileName=""+year+""+month+""+day+".txt"; String key=""+year+""+month+""+day; String dialyFile[]=dir.list(); boolean b=false; for(int i=0;i<dialyFile.length;i++) { if(dialyFile[i].startsWith(key)) { b=true;
break;
}
}
if(b)
{
int n=JOptionPane.showConfirmDialog(this,""+year+"年
"+month+"月"+day+"日"+"已经有日志存在,是否添加日
志,","确认对话框",JOptionPane.YES_NO_OPTION);
if(n==JOptionPane.YES_OPTION)
{
try
{
File file=new File(dir,fileName);
RandomAccessFile out=new RandomAccessFile(file,"rw");
long end=out.length();
byte[]bb=dailyRecord.getBytes();
out.seek(end);
out.write(bb);
out.close();
}
catch(IOException e){}
text.setText("");
}
else
{
text.setText("");
}
}
else
{
int n=JOptionPane.showConfirmDialog(this,"是否添加"+year+"年"+month+"月"+day+"日"+"日志,","确认对话框",JOptionPane.YES_NO_OPTION);
if(n==JOptionPane.YES_OPTION)
{
try
{
File file=new File(dir,fileName);
FileWriter fw=new FileWriter(file);
BufferedWriter bw=new BufferedWriter(fw);
bw.write(dailyRecord);
bw.close();
fw.close();
}
catch(IOException e){}
JOptionPane.showMessageDialog(this,"添加日志成功","消息对话框
",JOptionPane.INFORMATION_MESSAGE);
text.setText("");
}
}
}
public void deletefile(File dir,int year,int month,int day)
{
String key=""+year+""+month+""+day;
String dialyFile[]=dir.list();
boolean b=false;
for(int i=0;i<dialyFile.length;i++)
{
if(dialyFile[i].startsWith(key))
{
b=true;
break;
}
}
if(b)
{
int n=JOptionPane.showConfirmDialog(this,"是否删除"+year+"年"+month+"月"+day+"日的日志,","确认对话框",JOptionPane.YES_NO_OPTION);
if(n==JOptionPane.YES_OPTION)
{
try
{
String
fileName=""+year+""+month+""+day+".txt";
File file=new File(dir,fileName);
file.delete();
}
catch(Exception e){}
text.setText("");
}
}
else
{
JOptionPane.showMessageDialog(this,""+year+"年"+month+"月"+day+"日无日志~","消息对话框",JOptionPane.INFORMATION_MESSAGE);
}
}
public void readfile(File dir,int year,int month,int day)
{
String
fileName=""+year+""+month+""+day+".txt";
String key=""+year+""+month+""+day;
String dialyFile[]=dir.list();
boolean b=false;
for(int i=0;i<dialyFile.length;i++)
{
if(dialyFile[i].startsWith(key))
{
b=true;
break;
}
}
if(b)
{
text.setText("");
try
{
File file=new File(dir,fileName);
FileReader inOne=new FileReader(file);
BufferedReader inTwo=new BufferedReader(inOne);
String s;
while((s=inTwo.readLine())!=null)
{
text.append(s+"\n");
}
inOne.close();
inTwo.close();
}
catch(IOException e){}
}
else
{
JOptionPane.showMessageDialog(this,""+year+"年"+month+"月"+day+"日无日志~","消息对话框",JOptionPane.INFORMATION_MESSAGE);
}
}
}
//CalendarMessage类
package others;
import java.util.Calendar;
public class CalendarMessage{
int year=-1,month=-1,day=-1;
public void setYear(int year){
this.year=year;
}
public int getYear(){
return year;
}
public void setMonth(int month){
if(month<=12&&month>=1)
this.month=month;
else
this.month=1;
}
public int getMonth(){
return month;
}
public void setDay(int day){
this.day=day;
}
public int getday()
{
return day;
}
public String [] getMonthCalendar(){
String [] day=new String[42];
Calendar rili=Calendar.getInstance();
rili.set(year,month-1,1);//将日历翻到year年month月1日
int 星期几=rili.get(Calendar.DAY_OF_WEEK)-1;
int dayAmount=0;
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
dayAmount=31;
if(month==4||month==6||month==9||month==11)
dayAmount=30;
if(month==2)
{
if(((year%4==0)&&(year%100!=0))||year%400==0)
dayAmount=29;
else
dayAmount=28;
}
for(int i=0;i<星期几;i++)
day[i]="";
for(int i=星期几,n=1;i<星期几+dayAmount;i++){
day[i]=String.valueOf(n);
n++;
}
for (int i=星期几+dayAmount;i<42;i++ )
day[i]="";
return day;
}
}
// CalendarImage类
package others;
import javax.swing.*;
import java.io.*;
import java.awt.*;
public class CalendarImage extends JPanel
{
File imageFile;
Image image;
Toolkit tool;
//构造
方法
快递客服问题件处理详细方法山木方法pdf计算方法pdf华与华方法下载八字理论方法下载
public CalendarImage() {
tool=getToolkit();//获取工具;
}
//设置图像文件;
public void setImageFile(File f)
{
imageFile =f;
try{
image=tool.getImage(imageFile.toURI().toURL());//得到图像文件; }
catch (Exception eeee)
{}
repaint();//重绘;
}
//重载paintComponent方法,覆盖原来的,供repaint()调用;
public void paintComponent(Graphics g)
{
super.paintComponent(g);
int w=getBounds().width;
int h=getBounds().height;
g.drawImage(image,0,0,w,h,this);
}
}
//Alarm类
package others;
import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.net.MalformedURLException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import javax.swing.*;
public class Alarm extends JPanel implements Runnable {
JLabel ri ,shi, fen, miao, dangqian;
JButton queding, dakai;
JTextField music,day, hour, minute, second;
int h=0,f=0,m=0,r=0;
boolean fo=false;
public AudioClip soumd1;
public Alarm() {
setLayout(new GridLayout(3, 1));
JPanel jp = new JPanel();
dangqian = new JLabel();
jp.add(dangqian);
add(jp);
JPanel jp1 = new JPanel();
music = new JTextField(20);
dakai = new JButton("选择闹铃音乐");
jp1.add(music);
jp1.add(dakai);
add(jp1);
ri = new JLabel("日");
day = new JTextField(4);
shi = new JLabel("时");
hour = new JTextField(4);
fen = new JLabel("分");
minute = new JTextField(4);
miao = new JLabel("秒");
second = new JTextField(4);
JPanel jp2 = new JPanel();
jp2.add(ri);jp2.add(day);jp2.add(shi);jp2.add(hour);jp2.add(fen);
jp2.add(minute);jp2.add(miao);jp2.add(second);
queding = new JButton("确定");
jp2.add(queding);add(jp2);
setSize(400, 130);
setVisible(true);
dakai.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
JFileChooser fileChooser = new JFileChooser(); // 实例化文件选择器
fileChooser
.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); // 设置文件选择模式,此处为文件和目录均可
fileChooser.setCurrentDirectory(new File(".")); // 设置文件选择器当前目录
fileChooser
.setFileFilter(new javax.swing.filechooser.FileFilter() {
public boolean accept(File file) { // 可接受的文件类型
String name = file.getName().toLowerCase();
return name.endsWith(".wav")
|| name.endsWith(".au")
|| file.isDirectory();
}
public String getDescription() { // 文件描述
return "音乐文件(*.wav,*.au)";
}
});
if (fileChooser.showOpenDialog(Alarm.this) == JFileChooser.APPROVE_OPTION) { // 弹出文件选择器,并判断是否点击了打开按钮
String fileName = fileChooser.getSelectedFile().getAbsolutePath(); // 得到选择文件或目录的绝对路径
music.setText(fileName);
}
}
});
queding.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if(queding.getText().equals("确定")){
try{
r=Integer.parseInt(day.getText());
h=Integer.parseInt(hour.getText());
f=Integer.parseInt(minute.getText());
m=Integer.parseInt(second.getText());
if(1<=h&&h<=31&&0<=h&&h<=23&&0<
;=f&&f<=59&&0<=m&&m<=59)
{
fo=true;
}
else
JOptionPane.showMessageDialog(null, "输入时间错误");
}
catch(Exception e){
JOptionPane.showMessageDialog(null, "请输入正确的时间");
}
}
else
{
fo=false;
day.setEditable(true);
hour.setEditable(true);
minute.setEditable(true);
second.setEditable(true);
queding.setText("确定");
//soumd1.stop();
}
}
});
Thread t1 = new Thread(this);
t1.start();
}
public void run() {
while (true) {
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒",Locale.SIMPLIFIED_CHINESE);
dangqian.setFont(new Font("微软雅黑",Font.BOLD,20));
dangqian.setForeground(Color.RED);
dangqian.setText("当前时间: " + sdf.format(now));
SimpleDateFormat ri=new SimpleDateFormat("dd"); //封装 为了获取日期 SimpleDateFormat shi=new SimpleDateFormat("kk"); //封装 为了获取小时 SimpleDateFormat fen=new SimpleDateFormat("mm"); //封装 为了获取分钟 SimpleDateFormat miao=new SimpleDateFormat("ss"); //封装 为了获取秒钟 int riqi=Integer.parseInt(ri.format(now)); //获取日期
int shizhong=Integer.parseInt(shi.format(now)); //获取小时
int fenzhong=Integer.parseInt(fen.format(now)); //获取分钟
int miaozhong=Integer.parseInt(miao.format(now)); //获取秒钟
if(fenzhong==0&&miaozhong==0)
try {
soumd1=Applet.newAudioClip(new File(music.getText()).toURL()); //播放音乐 soumd1.play();
fo=false;
} catch (MalformedURLException e) {
e.printStackTrace();
}
if(fo)
{
day.setEditable(false);
hour.setEditable(false);
minute.setEditable(false);
second.setEditable(false);
queding.setText("关闭");
if(riqi==r&&shizhong==h&&fenzhong==f&&miaozhong==m) //
判断条件 {
try {
soumd1=Applet.newAudioClip(new File(music.getText()).toURL()); //播放音乐 soumd1.play();
fo=false;
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}
try {
Thread.sleep(1000);
} catch (InterruptedException ie) {
}
}
}
}