Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

[JList] Removing key actions  RSS feed

 
Paul Song
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a problem with removing key actions connected with jlist (located in viewport).
I tried this bunch of code:

but it removes actions also from all others jlists in a frame. This parentInputMap is shared? :/

Following code also doesn't work:

Could you tell me how can I remove all key bindings from this particular list?

Thanks for your help,
Paul
 
Rob Camick
Ranch Hand
Posts: 2800
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but it removes actions also from all others jlists in a frame. This parentInputMap is shared?


Yes.

Could you tell me how can I remove all key bindings from this particular list?


I would guess you can't remove them (see above) but you should be able to override them. You would do this by adding an entry in the InputMap of the component to point to a non existent Action. So for each binding you would need to do:



 
Paul Song
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works great - thanks
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!