title: Java text field hit tab to create a tag
body: <p>I am trying to create a text field similar to the 'tags' field in the Stackoverflow flow 'ask a question' page. That is, every time the use hits tab, the preceding text gets enclosed in a colored rounded rectangle and becomes a 'tag'.</p>
  
  <p>I have started to do this by extending a JTextField; however, it is quite tedious, especially since I am doing custom painting.</p>
  
  <p>Do you have any ideas how to approach this?</p>
  
  <p>Thanks in advance!</p>