Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with GlassPane intercepting Key events  RSS feed

 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My idea was to set a GlassPane( which covers the entire application ) and intercepts Key presses to tell if I get a control + s or a control + t. This is what I did...



All its doing now is showing the key code's to see if Its getting the key events, which its not. I could however setFocusable(true) in the constructor but that would go away as soon as a component gets the focus. I simply want all key presses to go through the glasspane so I can check for a specific combination of presses. Any help?
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out key bindings instead.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!