java button属性设置_java的JButton怎样设置内边距
import java.io.IOException;
public class SetTime {
public static void main(String args[]){
String osName = System.getProperty("os.name");
String cmd = "";
try {
if (osName.matches("^(?i)Windows.*$")) {// Window 系統
// 格式 HH:mm:ss
cmd = " cmd /c time 22:35:00";
Runtime.getRuntime().exec(cmd);
// 格式:yyyy-MM-dd
cmd = " cmd /c date 2009-03-26";
Runtime.getRuntime().exec(cmd);
} else {// Linux 系統
// 格式:yyyyMMdd
cmd = " date -s 20090326";
Runtime.getRuntime().exec(cmd);
// 格式 HH:mm:ss
cmd = " date -s 22:35:00";
Runtime.getRuntime().exec(cmd);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
取消
評論
總結
以上是生活随笔為你收集整理的java button属性设置_java的JButton怎样设置内边距的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【ARM汇编】打印金字塔 | 打印倒三角
- 下一篇: Oracle递归死循环怎么办?