Caret « JTextArea « Java Swing Q&A





1. Set Caret position with JTextArea in JScrollPane    stackoverflow.com

Right now I have a JTextArea inside of a JScrollPane. For the current content it has both a vertical and horizontal scroll bar showing up. I'm trying to implement a search ...

2. Setting caret position in JTextArea    stackoverflow.com

I have a JTextArea. I have a function that selects some amount of text when some combination is called. It's done properly. The thing is, I want to move caret to ...

3. set background color from start to end char position    stackoverflow.com

What would be an easy way to set the background color of all characters from some start to an end position in Java.

Eg:
red background from position D(4) to J(10)
String alpha = ...

4. Customization of scroll+caret behaviour in JTextArea+JScrollPane    stackoverflow.com

I have a problem implementing the behavior I want in mentioned components. The behavior I want is:
1) By default, when new content is appended to JTextArea, it's auto scrolling to ...

5. JTextArea show Caret while setEditable is false    stackoverflow.com

How can I put Caret in JTextArea while setEditable is disabled? A sample code when I need Caret to be visible:

public void run(){
    JFrame frame = new JFrame();
  ...