Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tag Input in Java Swing [closed]

We have multiple tag input in JS ( picture )

Tag Input on JS

I wanted to know is there any default Java Swing facility to do it within JTextField or JTextArea. Is there any custom look-and-feel library or plugin to do so ?

Thanks a lot !

like image 513
shuvomiah Avatar asked Oct 25 '25 15:10

shuvomiah


1 Answers

No, there is no such component. You should be able to make your own easy enough:

  1. Start with a JPanel using a FlowLayout and add a JTextField to the panel
  2. Then you can add an ActionListener to the text field. When ever Enter is pressed you create a "TagComponnent" and add the component to the start of the panel and remove the text from the text field.
  3. This "TagComponent" may just be a simple panel that contains a label (for the text) and a button (to remove) the component from the panel.
like image 183
camickr Avatar answered Oct 27 '25 04:10

camickr