0

Is it possible to have a JTextField with a drop-down list similar to the implementations of search via different engines?

I'm trying to deliver table column filtration and addition/removal via a such a component.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • 1
    See this question http://stackoverflow.com/questions/10897839/how-to-implement-auto-complete-functionality-in-a-cell-in-jtable – Francisco Puga Jun 07 '12 at 08:09

2 Answers2

3

An editable JCombobox has a JTextField as editor, so that is very close to what you want. You can combine this with autocompletion functionality (e.g. by using SwingX which allows to decorate a combobox and making autocompletion a one-liner)

Robin
  • 36,233
  • 5
  • 47
  • 99
0

JComboBox gives you the flexibility of a TextField and a List.

Eg:

JComboBox<String> combo = new JComboBox<String>();
combo.setEditable(true);

setEditable(true) will make the JComboList behave editable like textfield.

Kumar Vivek Mitra
  • 33,294
  • 6
  • 48
  • 75