private void alignWindow(Dimension frameSize, Dimension screenSize, Position position)
  {
    int width = screenSize.width;
    int height = screenSize.height;

    int x = 0;
    int y = 0;

    switch (position)
    {
      case UPPER_LEFT:
        break;
      case UPPER:
        x = width / 2 - frameSize.width / 2;
        break;
      case UPPER_RIGHT:
        x = width - frameSize.width;
        break;
      case RIGHT:
        x = width - frameSize.width;
        y = height / 2 - frameSize.height / 2;
        break;
      case LOWER_RIGHT:
        x = width - frameSize.width;
        y = height - frameSize.height;
        break;
      case LOWER:
        x = width / 2 - frameSize.width / 2;
        y = height - frameSize.height;
        break;
      case LOWER_LEFT:
        y = height - frameSize.height;
        break;
      case LEFT:
        y = height / 2 - frameSize.height / 2;
        break;
    }
    setBounds(x, y, frameSize.width, frameSize.height);
  }