Skip to content
Snippets Groups Projects
Select Git revision
  • c9a031fc104d0d8f1f46ac01247687dee957f0e5
  • main default protected
  • 1-fix-assignment-errors
  • testsfail
4 results

DotsAndBoxesGridTest.java

Blame
  • Main.java 993 B
    package dotsandboxes;
    
    import javax.swing.*;
    import java.awt.*;
    
    /** Our main class that launches the app. */
    public class Main {
        
        public static void main(String... args) throws Exception {
    
            JFrame mainWindow = new JFrame("Dots and Boxes");
            DotsAndBoxesGrid grid = new DotsAndBoxesGrid(15, 8, 2);
    
            // FIXME: Update this label to show your name and student number
            JLabel label = new JLabel("Name: Jennica Llamera 220278632");
    
            JPanel borderPane = new JPanel(new BorderLayout());
            borderPane.add(label, BorderLayout.SOUTH);
    
            DotsAndBoxesUI dbUi = new DotsAndBoxesUI(grid);
            borderPane.add(dbUi.anchorPane, BorderLayout.CENTER);
            borderPane.add(dbUi.label, BorderLayout.NORTH);
            mainWindow.add(borderPane);
    
            mainWindow.pack();
            mainWindow.setVisible(true);
    
            // This sets what to do when we close the main window.
            mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        }
    
    }