-1

I need to trigger a JList with items when I press @ in a JTable's row in Swing, when the user selects an item the JList should disappear, anyone know how I can achieve this?

enter image description here

mKorbel
  • 109,525
  • 20
  • 134
  • 319
iberck
  • 2,372
  • 5
  • 31
  • 41
  • Just curious, why the requirement for the @ symbol? Would you not want the user to see the valid options in another scenerio? – splungebob Feb 28 '14 at 21:25
  • Yes, the "@" is only an example, I need to trigger the list when the user press a special symbol. – iberck Feb 28 '14 at 21:30

2 Answers2

0

There's an example in the tutorials for that exact scenario: Using A Combobox As A Table Editor. You could trigger the start of the editor (via the @ symbol) with KeyBindings

splungebob
  • 5,357
  • 2
  • 22
  • 45
  • The example has no relation with the scenario described. – iberck Feb 28 '14 at 21:28
  • `The example has no relation with the scenario described` Oh, so you *already know* how to use a combobox as a table cell editor? Great. I must've missed that in the OP. Now you just need to apply the KeyBindings for the "@" symbol and you're all set – splungebob Mar 01 '14 at 15:55
-1

Have you tried using the KeyPressed event? You should be able to see if the @ has then been entered, then show the JList.

Adam Carlin
  • 244
  • 1
  • 3
  • 15