Select « JTextArea « Java Swing Q&A





1. Swing: Programmatically select a text    stackoverflow.com

I have a very simple Swing GUI with just a JTetxtArea. I am trying to programmatically select a part of text using:

textArea.select(startSelection,endSelection);
This work. However as soon as I add some other ...

2. Select fragment of a text in JTextArea    stackoverflow.com

I need to select some fragment of a text in JTextArea. How should i do that?...

5. Partial selection of Text in textArea    coderanch.com

6. Multiple text selection in JTextArea    coderanch.com

Rob, I'm not sure you are correct. Open a Microsoft Word document (I know, I hate MS too). Now, use the mouse to select the first paragraph. Next, press the Control key and use the mouse to select a second paragraph elsewhere in the document. Do a "Copy" and then open a new Word document and do a Paste. The two ...

7. Problem with select(int start, int end) method of TextArea    coderanch.com

Hi ranchers, I am stuck in a problem while using the select method of TextArea class. Here is my code: import javax.swing.*; import java.awt.event.*; class MyText implements ActionListener{ JFrame f; JTextArea ta; JButton bFind; MyText(){ f = new JFrame("Find and Replace"); f.setResizable(false); f.setBounds(300,300,300,300); f.setLayout(null); ta = new JTextArea(); ta.setBounds(10,10,270,150); ta.setLineWrap(true); ta.setText("This is some text which needs to be selected by find() ...

9. Updating selected text in a JTextArea    forums.oracle.com

Hi, How do I update a selected text in a JText Area. ex: the content of the text area initially is : This is the first sentence. I would like to update this to become: This is the second sentence. by selecting the word first and then rightclicking on it a menu will popup and lets me choose the word second. ...