Code example for JTextComponent

Methods: addKeyListener

0
	 
	public boolean isCarentAtEndOfTextAtRemoval() { return textComponent.getCaretPosition() == textComponent.getText().length() + 1; }
	 
	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();
Contextual code suggestions in your IDE  Get Codota for Java