code: public void setPageSize(int s) {
          if (s <= 0) {
              throw new IllegalArgumentException("non-positive page size: " + s);
          }
      
          if (s == pageSize) {
              return;
          }
          
          int oldPageSize = pageSize;
          pageSize = s;
          page = (oldPageSize * page) / pageSize;
          fireTableDataChanged();
      }
docs: Sets the page size.
  @param s the page size.