Code example for JTextComponent

Methods: addFocusListener

0
	 
	public JTextComponent getTextComponent() { return textComponent; }
	 
	public void addKeyListener(KeyAdapter adapter) { textComponent.addKeyListener(adapter); }
	 
	public void addFocusListener(FocusListener listener) { textComponent.addFocusListener(listener); }
	 
	 
	/** 
	 * 	getItemsNames 
	 *  
	 * @return empty Vector if component is not an EditableComboBox, 
	 *  otherwise return Vector which contains the names of the combobox items. 
	 */ 
	public Vector<String> getItemNames() {
		Vector<String> result = new Vector<>();
		if (editableComboBox != null) {
			int nbItems = editableComboBox.getItemCount();
			for (int i=0; i < nbItems; i++)
				result.add(editableComboBox.getItemAt(i).toString());
Connect your IDE to all the code out there  Get Codota for Java