📄 statuswindow.java
字号:
/*
* StatusWindow.java E.L. 2001-08-25
*
* This window is used at the client side for showing status information,
* received from the server side. It's not possible to close the window. The user has to
* exit the application by closing the CounterWindow, then he is disconnected
* from the server, too. And this window is closed.
*/
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.awt.*;
class StatusWindow extends JFrame implements Constants{
private JLabel text = new JLabel("No message from the server yet.");
public StatusWindow() {
setTitle("Status");
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
Container guiContainer = getContentPane();
text.setForeground(Color.black);
guiContainer.add(new JLabel(), BorderLayout.NORTH);
guiContainer.add(text, BorderLayout.CENTER);
guiContainer.add(new JLabel(), BorderLayout.SOUTH);
setLocation(locationStatusWindowX, locationStatusWindowY);
setSize(widthStatusWindow, heightStatusWindow);
}
public void setStatus(String newStatus) {
text.setText(" " + newStatus);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -