All pastes #561683 Raw Edit

damnn

public java v1 · immutable
·published 2007-06-12 15:15 UTC
rendered paste body
/** * @(#)MineSwing.java * * * @author  * @version 1.00 2007/5/29 */import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.util.Random;public class MineSwing extends JFrame{   	//Minesweeper Win    public MineSwing(int getX, int getY, int getMine) {    	    	//Basic Window Operations     	super("Minesweeper");    	setSize(260,320);    	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);    	    	int[] x,y = new int[getMine];    	    	ImageIcon icon = new ImageIcon("blank.gif", "a right arrow");    	    	//Content Declarations (Top-Level)    	BorderLayout myBox = new BorderLayout();    	Container mainPane = getContentPane();    	mainPane.setLayout(myBox);    	    	//Information Panel Declarations    	FlowLayout infoLayout = new FlowLayout();    	JPanel infoPanel = new JPanel();    	infoPanel.add(new JButton("Shoo"));    	//Mine Grid Declarations    	GridLayout gameLayout = new GridLayout(getX, getY);    	JPanel mineGrid = new JPanel();    	JButton[] gameGrid = new JButton[getX * getY];    	mineGrid.setLayout(gameLayout);    	Random generator = new Random();    	//for (int i = 0; i < getMine; i ++){    	//	x[i] = generator.nextInt(getX);    	//	y[i] = generator.nextInt(getY);    	//}    	    	for (int i = 0; i < gameGrid.length; i++){    		gameGrid[i] = new JButton(icon);    		//if (gameGrid[i]){    		//}    		mineGrid.add(gameGrid[i]);    	}    	    	//Adding Content (Top-Level)    	mainPane.add( infoPanel, BorderLayout.PAGE_START);//TopPanel - Include Time/MineCount and Smiley    	mainPane.add( mineGrid, BorderLayout.CENTER);// Mine Grid.    	mainPane.add(new JLabel ("  "), BorderLayout.LINE_START);    	mainPane.add(new JLabel (" "), BorderLayout.LINE_END);    	mainPane.add(new JLabel (""), BorderLayout.PAGE_END);    	setVisible(true);    }        public static void main(String[] args){    int xBound, yBound, mineCount;   	xBound = 10;   	yBound = 10;   	mineCount = 10;   	    MineSwing game = new MineSwing(xBound, yBound, mineCount);   	  	    }    }