title: java (autocomplete) multiple selection/values in textfield
body: <p>I am working on a project where I need to implement a Component that provides an "autocomplete multiple selection" function.</p>
  
  <p>Sure, I read a lot of tutorial and viewed lots of examples but I did not find anything to solve my problem. The last days I was searching and searching and finally the best component I have seen was this one:</p>
  
  <p><img src="https://i.stack.imgur.com/9Ttqb.png" alt="Primefaces autocomplete multiple selection"></p>
  
  <p>Stackoverflow supports this kind of function as well when you ask a new question and have to specify the tags you want.
  But this is css and Java is not able to handle "complex" css stylesheets. :/</p>
  
  <p>So, I wonder if this can be done with pure Java.</p>
  
  <p>If not, it would be really enough to have a textfield (or another field?) that includes different components to separate different inputs as shown in the picture. This is exact what I need. </p>
  
  <p><strong>A field that includes components which can be removed by clicking on "X"</strong></p>
  
  <p>But I am not sure if this can be solved with Java.
  I need a way to separate different inputs in a textfield (or another component?) like adding a border around texts.
  It sounds easy but I guess it can be really tricky. . .</p>
  
  <p>Does anyone have any suggestions? or ideas how I can solve my problem?
  I would really appreciate it because I ran out of ideas.</p>
  
  <p>URL to PrimeFaces: <a href="http://www.primefaces.org/showcase-labs/ui/autoCompleteMultiple.jsf" rel="nofollow noreferrer">http://www.primefaces.org/showcase-labs/ui/autoCompleteMultiple.jsf</a></p>
  
  <p>Ioannis K.</p>