javajs.swing.JComboBox Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmol Show documentation
Show all versions of jmol Show documentation
Jmol: an open-source Java viewer for chemical structures in 3D
package javajs.swing;
import javajs.util.SB;
public class JComboBox extends AbstractButton {
private String[] info;
private int selectedIndex;
public JComboBox(String[] info){
super("cmbJCB");
this.info = info;
}
public void setSelectedIndex(int i) {
selectedIndex = i;
/**
* @j2sNative
*
* SwingController.setSelectedIndex(this);
*
*/
{
}
}
public int getSelectedIndex() {
return selectedIndex;
}
public Object getSelectedItem() {
return (selectedIndex < 0 ? null : info[selectedIndex]);
}
@Override
public String toHTML() {
SB sb = new SB();
sb.append("\n\n");
return sb.toString();
}
}