📄 myframe.java
字号:
import java.io.IOException;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JButton;
public class MyFrame extends JFrame implements ActionListener {
public MyFrame() {
super("MyFrame");
getContentPane().setLayout(new FlowLayout());
getContentPane().add(new JLabel("Thread-Per-Message Sample"));
JButton button = new JButton("Execute");
getContentPane().add(button);
button.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
Service.service();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -