📄 helpserver.java
字号:
package viewtuba1;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
public class HelpServer extends JDialog {
/**
* Launch the application
*
* @param args
*/
public static void main(String args[]) {
try {
HelpServer dialog = new HelpServer();
dialog.setTitle("帮助");
dialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog
*/
public HelpServer() {
super();
Color bg = new Color(255, 255, 255);
getContentPane().setBackground(bg);
getContentPane().setLayout(null);
setBounds(100, 100, 271, 268);
final JLabel label = new JLabel();
label.setText("聊天室服务端帮助");
label.setBounds(78, 10, 123, 22);
getContentPane().add(label);
final JTextArea textArea = new JTextArea();
textArea.setText("1、设置所有连接服务器的IP地址和" + "端\n口"
+ "(默认设置为127.0.0.1:8888)。\n" + "2、点击启动服务按钮可在指定的端口\n启动服务。\n"
+ "3、选择需要接受消息的用户,在消息\n栏中写入消息,之后便可以发送消息。\n"
+ "4、信息状态栏中显示服务器当前的启\n动与停止状态、用户发送的系统消息和\n服务器端发送的系统消息。\n");
textArea.setEditable(false);
textArea.setBounds(28, 32, 212, 165);
getContentPane().add(textArea);
final JButton button = new JButton();
button.setText("关闭");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
dispose();
}
});
button.setBounds(101, 198, 64, 21);
getContentPane().add(button);
//
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -