Class ValueBox

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.episteme.natural.chemistry.loaders.cml.util.ValueBox
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ValueBox extends JPanel
A Swing JPanel containing a label and a combo box for selecting values.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • ValueBox

      public ValueBox(String prompt, String[] values)
      Creates a new ValueBox object.
      Parameters:
      prompt - the text for the label
      values - the array of values for the combo box
  • Method Details

    • setSelectedIndex

      public void setSelectedIndex(int index)
      Sets the selected index in the combo box.
      Parameters:
      index - the index to select
    • getSelectedIndex

      public int getSelectedIndex()
      Returns the currently selected index.
      Returns:
      the index
    • getSelectedValue

      public String getSelectedValue()
      Returns the currently selected value string.
      Returns:
      the value string
    • setSelectedValue

      public void setSelectedValue(String value)
      Sets the selected value by matching the given string.
      Parameters:
      value - the string value to select