在一个窗口中输出当前系统时间,不需要更新,就是当前那一刻的时间
String r;
Date d=new Date();
r=d.toLocaleString();
setLayout(new FlowLayout(FlowLayout.CENTER, 10,10));
Label a=new Label(r);
add(a);
为何不能输出,小弟新手请各位指教
String r;
Date d=new Date();
r=d.toLocaleString();
setLayout(new FlowLayout(FlowLayout.CENTER, 10,10));
Label a=new Label(r);
add(a);
为何不能输出,小弟新手请各位指教
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(500,500);
setLayout(new FlowLayout(FlowLayout.CENTER, 10,10));
JLabel jl = new JLabel(new Date().toString());
add(jl);这样没问题,昨天回复没成功