posted 21 years ago
Hi,
I'm trying to listen to keyevents on the JTableHeader of a JTable by adding a keyListener directly on it but it seems not to work...
As told in Sun Swing tutorial, only components with keyboard focus can send such events. So I tried to force the focus on the header but this didn't work either...
The only workaround I found was to override addKeyListener() on the header to register the listener to the parent JTable instead of the header itself...
The problem is I don't find this is a good solution... Has anybody tried this and has found a better way to achieve this ?
Thanks