📄 helpchat.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.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
public class HelpChat extends JFrame {
/**
* Launch the application
*
* @param args
*/
public static void main(String args[]) {
try {
HelpChat dialog = new HelpChat();
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 HelpChat() {
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"
+ "可选择悄悄话模式,并能选择表情聊天。");
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 + -