void selectCategory(EmojiCategory category) {
    if (myCurrentPanel != myCategoriesPanel) {
      setViewportView(myCurrentPanel = myCategoriesPanel);
    }
    if (category == null || category == myCategoriesPanel.myCategories.get(0).myCategory) {
      setCurrentItem(myCategoriesPanel.myCategories.get(0).myCategory.getEmoji().isEmpty() ?
                     myCategoriesPanel.myCategories.get(1) : myCategoriesPanel.myCategories.get(0), 0);
      myCategoriesPanel.scrollRectToVisible(new Rectangle(0, 0, 1, getHeight()));
    }
    else {
      Category cat = null;
      for (Category c : myCategoriesPanel.myCategories) {
        if (c.myCategory == category) cat = c;
      }
      if (cat == null) return;
      setCurrentItem(cat, 0);
      cat.scrollRectToVisible(new Rectangle(0, 0, 1, getHeight()));
    }
  }
void selectCategory(EmojiCategory category)