code: public boolean displayingAbove() {
  
          int popupHeight = getPopupHeight();
          // Calculate top position for the popup
          int top = m_opener.getAbsoluteTop();
  
          // Make sure scrolling is taken into account, since
          // box.getAbsoluteTop() takes scrolling into account.
          int windowTop = Window.getScrollTop();
          int windowBottom = Window.getScrollTop() + Window.getClientHeight();
  
          // Distance from the top edge of the window to the top edge of the
          // text box
          int distanceFromWindowTop = top - windowTop;
  
          // Distance from the bottom edge of the window to the bottom edge of
          // the text box
          int distanceToWindowBottom = windowBottom - (top + m_opener.getOffsetHeight());
  
          // If there is not enough space for the popup's height below the text
          // box and there IS enough space for the popup's height above the text
          // box, then then position the popup above the text box. However, if there
          // is not enough space on either side, then stick with displaying the
          // popup below the text box.
          boolean displayAbove = (distanceFromWindowTop > distanceToWindowBottom)
              && (distanceToWindowBottom < popupHeight);
          return displayAbove;
      }
docs: Returns whether the select options are being displayed below or above the widget.<p>
  
  @return <code>true</code> in case the select options are displayed above the widget