private static int computeDisplayCellSize(Dimension dims)
    {
        int maxWidth = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().width - 130;
        int maxHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().height - 130;
        int fullCols = maxWidth/dims.width;
        int fullRows = maxHeight/dims.height;
        int fullSide = (fullCols < fullRows) ? fullCols : fullRows;
        return (fullSide < 20) ? fullSide : 20; 
    }