每次点击jButton时我想写一个jtextarea。我不知道该怎么做,因为我这样做只会打印一行。
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Calendar calendar = Calendar.getInstance();
int hours = calendar.get(Calendar.HOUR_OF_DAY);
int minutes = calendar.get(Calendar.MINUTE);
int seconds = calendar.get(Calendar.SECOND);
jTextArea1.setText("Comienza el partido...." + hours + ":" + minutes + ":" + seconds
+ ":\n");
jTextArea1.setText("Resultado:" + " " + marcador1.MLocal() + " " + marcador1.MVisitante()
+ " " + hours + ":" + minutes + ":" + seconds + "\n");
}
我想要那样的东西:
Match start!
local 1 -visitant 0
local 2-visitant 0
local 2-visitant 1
Thank you !