Here you can find the source of indexesOf(DefaultListModel model, String sa[])
Parameter | Description |
---|---|
model | The model to search in |
sa | The Strings to search for |
public static int[] indexesOf(DefaultListModel model, String sa[])
//package com.java2s; /*/*from w w w . jav a 2s .c om*/ * PackJacket - GUI frontend to IzPack to make Java-based installers * Copyright (C) 2008 - 2009 Amandeep Grewal, Manodasan Wignarajah * * PackJacket is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PackJacket is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PackJacket. If not, see <http://www.gnu.org/licenses/>. */ import javax.swing.DefaultListModel; public class Main { /** * Returns all the indexes of elements in a model. * @param model The model to search in * @param sa The Strings to search for * @return The indexes of the elements */ public static int[] indexesOf(DefaultListModel model, String sa[]) { int[] ia = new int[sa.length]; for (int x = 0; x < sa.length; x++) ia[x] = model.indexOf(sa[x]); return ia; } }