return new Point(0, convertRowToY(index));
int layoutOrientation = list.getLayoutOrientation(); Point loc = null; switch (layoutOrientation) { case JList.VERTICAL: loc = new Point(0, convertRowToY(index)); break; case JList.HORIZONTAL_WRAP:  int visibleRows = list.getVisibleRowCount(); int numberOfCellsPerRow = -1; if (visibleRows <= 0) { Dimension listDim = list.getSize(); numberOfCellsPerRow = Math.max(listDim.width / cellWidth, 1); } else { int numberOfItems = list.getModel().getSize(); numberOfCellsPerRow = numberOfItems / visibleRows + 1; }  int gridX = index % numberOfCellsPerRow; int gridY = index / numberOfCellsPerRow; int locX = gridX * cellWidth; int locY = gridY * cellHeight; loc = new Point(locX, locY); break; case JList.VERTICAL_WRAP:  int visibleRows2 = list.getVisibleRowCount(); if (visibleRows2 <= 0) { Dimension listDim2 = list.getSize(); visibleRows2 = listDim2.height / cellHeight; }  if (visibleRows2 > 0) { int gridY2 = index % visibleRows2; int gridX2 = index / visibleRows2; int locX2 = gridX2 * cellWidth; int locY2 = gridY2 * cellHeight; loc = new Point(locX2, locY2); } else loc = new Point(0, convertRowToY(index)); break; } return loc;
  public Point indexToLocation(JList list, int index)  {    return new Point(0, convertRowToY(index));  }