This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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?