public void alignComponents() {
        int gridX, gridY;

        switch (gridHAlign) {
            case (H_ALIGN_LEFT) : {
                gridX = this.getLocationX();
                break;
            }
            case (H_ALIGN_CENTER) : {
                gridX = this.getLocationX() + this.getWidth()/2 - grid.getWidth()/2;
                break;
            }
            case (H_ALIGN_RIGHT) : {
                gridX = this.getLocationX() + this.getWidth() - grid.getWidth();
                break;
            }
            default : {
                gridX = this.getLocationX();
            }
        }

        switch (gridVAlign) {
            case (V_ALIGN_TOP) : {
                gridY = this.getLocationY();
                break;
            }
            case (V_ALIGN_CENTER) : {
                gridY = this.getLocationY() + this.getHeight()/2 - grid.getHeight()/2;
                break;
            }
            case (V_ALIGN_BOTTOM) : {
                gridY = this.getLocationY() + this.getHeight() - grid.getHeight();
                break;
            }
            default : {
                gridY = this.getLocationY();
            }
        }

        for (int r = 0; r < grid.getNumRows(); r++) {
            for (int c = 0; c < grid.getNumColumns(); c++) {
                cells[r][c].setBounds(gridX + grid.getColumnOffset(c), gridY + grid.getRowOffset(r), grid.getColumnWidth(c), grid.getRowHeight(r));
            }
        }
    }