📄 userbookframe.java
字号:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class UserBookFrame extends JFrame
{
private JPanel content;
private JButton okButton;
private JTextArea test;
private static final UserBookFrame UserBook = new UserBookFrame();
public static UserBookFrame singleUserBookFrame()
{
return UserBook;
}
private UserBookFrame()
{
initUserBookFrame();
ClickActionListener cal = new ClickActionListener();
okButton.addActionListener(cal);
}
private void initUserBookFrame()
{
this.setTitle("用户手册");
content = new JPanel();
test = new JTextArea("在登录界面输入正确的用户名和密码可进入本系统.");
test.setBackground(content.getBackground());
test.setEditable(false);
okButton = new JButton("确定");
content.add(test);
content.add(okButton);
content.setLayout(new FlowLayout());
this.add(content);
this.setSize(300,300);
this.setVisible(true);
}
class ClickActionListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand() == "确定")
{
System.out.println("ddddddddddddddd");
UserBook.dispose();
/* this.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
e.getWindow().setVisible(false);
}
});*/
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -