26 lines
368 B
Java
26 lines
368 B
Java
package org.hwo.ui;
|
|
|
|
import javax.swing.JComboBox;
|
|
|
|
public class JComboBoxEx extends JComboBox {
|
|
|
|
|
|
public void selectEqualItem(Object o)
|
|
{
|
|
for (int i=0;i<getItemCount();i++)
|
|
if (getItemAt(i).equals(o))
|
|
{
|
|
setSelectedIndex(i);
|
|
return;
|
|
}
|
|
}
|
|
|
|
public void setItems(Object[] items){
|
|
removeAllItems();
|
|
for (Object o:items)
|
|
addItem(o);
|
|
}
|
|
|
|
|
|
}
|