public static void window() throws InterruptedException
    {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        //Center in screen
        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        frame.setLocation(dim.width/2-frame.getSize().width/2, dim.height/2-frame.getSize().height/2);
        
        Container cp = frame.getContentPane();
        cp.setLayout(new GridLayout(X, Y));
        
        int g = 0;
        while(g < Generations)
        {
            if(g == 0)//Initial State
            {
                randomBoard();//Initial Board
                
                for(int j = 0; j < X; j++)
                    for(int k = 0; k < Y; k++)
                        cp.add(Dots[j][k]);                
                
                frame.pack();
                frame.setVisible(true);
            }
            else
            {
                gameOfLife();//Conway's Game Of Life
            }
            
            for(int j = 0; j < X; j++)   
            {
                for(int k = 0; k < Y; k++)
                {
                    if(TwoD[j][k].alive)
                        Dots[j][k].setText("\u2588");
                    else
                        Dots[j][k].setText("");
                }
            }
            frame.pack();
            Thread.sleep(FrameRate);
            g++;
        }
    }