Code example for JTextComponent

Methods: getTextsetCaretPosition

0
	 
	public int getHeight() { return textComponent.getHeight(); }
	 
	public Rectangle modelToView() throws BadLocationException { return textComponent.getUI().modelToView(textComponent, textComponent.getCaretPosition()); }
 
	public void moveCarentToEndOfText() { textComponent.setCaretPosition(textComponent.getText().length()); }
	 
	public boolean isCarentAtEndOfTextAtInsertion() { return textComponent.getCaretPosition() == textComponent.getText().length() - 1; }
	 
	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 
Experience pair programming with AI  Get Codota for Java