Class JLabeledChoice

  • All Implemented Interfaces:
    java.awt.MenuContainer , java.awt.image.ImageObserver , java.io.Serializable , javax.accessibility.Accessible , javax.swing.TransferHandler.HasGetTransferHandler , org.apache.jorphan.gui.JLabeledField

    
    public class JLabeledChoice
    extends JPanel implements JLabeledField
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      List<JComponent> getComponentList() Get the label JLabel followed by the combo-box @link JComboBox.
      void setEditable(boolean editable)
      void addValue(String item)
      void setValues(Array<String> items)
      void setChoiceListEnabled(boolean enabled)
      void setLabel(String pLabel) Set the text displayed in the label.
      void setText(String pText) Set the text displayed in the Text Field.
      void setSelectedIndex(int index)
      String getText() Returns the text in the Text Field.
      int getSelectedIndex()
      Array<Object> getSelectedItems()
      Array<String> getItems()
      String getLabel() Returns the text of the label.
      void setToolTipText(String text) Registers the text to display in a tool tip.
      String getToolTipText() Returns the tooltip string that has been set with setToolTipText
      void addChangeListener(ChangeListener pChangeListener) Adds a change listener, that will be notified when the text in the text field is changed.
      void removeChangeListener(ChangeListener pChangeListener) Removes a change listener.
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, contains, createToolTip, disable, enable, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getTopLevelAncestor, getTransferHandler, getUI, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, addContainerListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, getComponent, getComponentAt, getComponentCount, getComponentZOrder, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
      • Methods inherited from class java.awt.Component

        action, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, createImage, createVolatileImage, dispatchEvent, enableInputMethods, getBackground, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusOwner, isFocusTraversable, isFocusable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusTraversalKeysEnabled, setFocusable, setIgnoreRepaint, setLocale, setLocation, setMixingCutoutShape, setName, setSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JLabeledChoice

        JLabeledChoice()
        Default constructor, The label and the Text field are left empty.
      • JLabeledChoice

        JLabeledChoice(String pLabel, boolean editable)
      • JLabeledChoice

        JLabeledChoice(String pLabel, Array<String> items)
        Constructs a non-editable combo-box with the label displaying the passed text.
        Parameters:
        pLabel - - the text to display in the label.
        items - - the items to display in the Combo box
      • JLabeledChoice

        JLabeledChoice(String pLabel, Array<String> items, boolean editable)
        Constructs a combo-box with the label displaying the passed text.
        Parameters:
        pLabel - - the text to display in the label.
        items - - the items to display in the Combo box
        editable - - if true, then Add and Delete buttons are created.
      • JLabeledChoice

        JLabeledChoice(String pLabel, Array<String> items, boolean editable, boolean withButtons)
        Constructs a combo-box with the label displaying the passed text.
        Parameters:
        pLabel - - the text to display in the label.
        items - - the items to display in the Combo box
        editable - - the box is made editable
        withButtons - - if true, then Add and Delete buttons are created.
    • Method Detail

      • setLabel

         void setLabel(String pLabel)

        Set the text displayed in the label.

        Parameters:
        pLabel - The new label text.
      • setText

         void setText(String pText)

        Set the text displayed in the Text Field.

        Parameters:
        pText - The new text to display in the text field.
      • getText

         String getText()

        Returns the text in the Text Field.

        Returns:

        The text in the Text Field. Never returns null.

      • getLabel

         String getLabel()

        Returns the text of the label.

        Returns:

        The text of the label.

      • setToolTipText

         void setToolTipText(String text)

        Registers the text to display in a tool tip. The text displays when the cursor lingers over the component.

        Parameters:
        text - the string to display; if the text is null, the tool tip is turned off for this component
      • getToolTipText

         String getToolTipText()

        Returns the tooltip string that has been set with setToolTipText

        Returns:

        the text of the tool tip

      • addChangeListener

         void addChangeListener(ChangeListener pChangeListener)

        Adds a change listener, that will be notified when the text in the text field is changed. The ChangeEvent that will be passed to registered listeners will contain this object as the source, allowing the new text to be extracted using the getText method.

        Parameters:
        pChangeListener - The listener to add