java按键发出声音代码_怎么在java中给按钮添加声音?
可以加入GTM時間,代碼如下:
public class ShowCurrentTime {
public static void main(String args[]){
//Obtain the total milliseconds since midnight,Jan 1,1970
long totalMilliseconds=System.currentTimeMillis();
//Obtain the total seconds since in midnight,Jan 1, 1970
long totalSeconds=totalMilliseconds/1000;
//compute the current second in the minute in the hour
long currentSecond=totalSeconds%60;
//Obtain the total minutes
long totalMinutes=totalSeconds/60;
//compute the current minute in the hour
long currentMinute=totalMinutes%60;
//Obtain the total hours
long totalHours=totalMinutes/60;
//compute the current hour
long currentHour=totalHours%24;
//display results
System.out.println("Current time is "+currentHour+" : "+currentMinute+" : "+currentSecond+" GMT");
}
}
取消
評論
總結
以上是生活随笔為你收集整理的java按键发出声音代码_怎么在java中给按钮添加声音?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 近一年涨跌幅什么意思?
- 下一篇: java8 新特性之流式数据处理_Jav