Limited selection in a JTextField/JTextComponent?
问题 Consider a JFormattedTextField (or any JTextComponent, really) wherein there is a prefix and a suffix displayed around what is the actual \"text\" of the field. For instance, the double 3.5 would be the String (via formatting) \"3.50\" around which would be the prefix \"$ \" and the suffix \"\", for a display text of \"$ 3.50\". Clearly, this is simple to do. However, the user is still allowed to select text within the prefix/suffix, so they could conceivably delete part or all of the prefix