程序如下:
import java.awt.*;
import javax.swing.*;
public class StatusPanel extends JPanel {
JLabel msgLabel = new JLabel();
JLabel timerLabel = new JLabel();
public StatusPanel() {
setLayout(new BorderLayout());
add(msgLabel, BorderLayout.CENTER);
add(timerLabel, BorderLayout.EAST);
}
public StatusPanel(String message) {
this();
setMessage(message);
}
public void setMessage(String message) {
msgLabel.setText(message);
}
public void setTimerMsg(String message) {
timerLabel.setText(message);
}
}
不知这this()这句是什么意思?