This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Grouping text in JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Grouping text in JTextArea" Watch "Grouping text in JTextArea" New topic
Author

Grouping text in JTextArea

Richard Robbins
Ranch Hand

Joined: Mar 07, 2001
Posts: 66
I am writing an application using a JTextArea, and I need to group text together so that a whole section is treated as a single object. I am creating messages which can have parameters substituted into them. These parameters are kept in a JComboBox. For instance, a message could look like this:
Hello <salutation> <lname>...
The parameters (salutation and lname) would be entered by selecting the parameter from the JComboBox and clicking a JButton, whereupon the parameter is entered into a message. I need a mechanism such that if a user decides to remove the parameter, he can move the cursor to the end of the parameter and hit backspace, and the whole parameter will be removed. In other words, this should not be possible:
Hello <salut... >
because the <salutation> parameter is grouped together and treated as if it were a single character/object. Any ideas?


Richard Robbins is one of the founders of WebsiteTemplateDatabase.com, a resource for free website templates and Photoshop tutorials. He also consults for an online boutique selling baptism dresses and christening gowns.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Grouping text in JTextArea
 
Similar Threads
Passing value from JApplet to Jsp page
SQL
installing JComboBox in JTable
Which Listener to use for JTextArea
remitting values