📄 enddialog.java
字号:
package ui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.awt.BorderLayout;
import javax.swing.BoxLayout;
import java.awt.GridLayout;
import logic.SnakeServer;
public class EndDialog extends JFrame{
private JButton contButton;
private JButton endButton;
private JPanel tile;
private String[] playerName;
public EndDialog() {
initialize();
}
public EndDialog(String[] name) {
this();
playerName = name;
endButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ResultUI(playerName);
dispose();
}
});
contButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dispose();
}
});
}
/**
* This method initializes this
*
*/
private void initialize() {
GridLayout gridLayout = new GridLayout();
gridLayout.setRows(1);
this.setSize(new java.awt.Dimension(332,188));
this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
this.setTitle("Quit");
contButton = new JButton();
contButton.setText("continue");
endButton = new JButton();
endButton.setText("quit");
tile = new JPanel();
tile.setLayout(gridLayout);
tile.add(contButton, null);
tile.add(endButton, null);
getContentPane().add(tile);
setVisible(true);
this.setContentPane(tile);
}
} // @jve:decl-index=0:visual-constraint="10,10"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -