⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 enddialog.java

📁 贪吃蛇网络版 运行平台 LINUX/UNIX Macintosh Windows Server 2003 Windows 2000 Windows XP Windows CE Windows 9*/
💻 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 + -