Focus and key events with SWT_AWT bridge [message #519924] |
Wed, 10 March 2010 09:20  |
Eclipse User |
|
|
|
Problem description:
I used Snippet154, because I'm trying to understand
why my Swing component embedded in SWT does not
react on key events. To check what is happenening
here I added
frame.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
System.out.println("keyPressed : " + e.paramString());
}
public void keyTyped(KeyEvent e) {
System.out.println("keyTyped : " + e.paramString());
}
public void keyReleased(KeyEvent e) {
System.out.println("keyReleased : " + e.paramString());
}
});
immediately before the readAndDispatch loop. Starting the test
program (Windows XP) and pressing any kind of key does not produce
any events (The listener is not called). The problem is: How
do I realize that?
Reason for the question: In my RCP app with a similar SWT_AWT
bridge I cannot call the help for the view presenting this
table. I thought it is related to the focus, but obviously
the table behaves as if it would have focus.
Any ideas are appreciated!
- Daniel
|
|
|
Re: Focus and key events with SWT_AWT bridge [message #519928 is a reply to message #519924] |
Wed, 10 March 2010 09:25  |
Eclipse User |
|
|
|
On 10.03.2010 15:20, Daniel Krügler wrote:
> Problem description:
>
> I used Snippet154, because I'm trying to understand
> why my Swing component embedded in SWT does not
> react on key events. To check what is happenening
> here I added
>
> frame.addKeyListener(new KeyListener() {
>
> public void keyPressed(KeyEvent e) {
> System.out.println("keyPressed : " + e.paramString());
> }
>
> public void keyTyped(KeyEvent e) {
> System.out.println("keyTyped : " + e.paramString());
> }
>
> public void keyReleased(KeyEvent e) {
> System.out.println("keyReleased : " + e.paramString());
> }
>
> });
>
> immediately before the readAndDispatch loop. Starting the test
> program (Windows XP) and pressing any kind of key does not produce
> any events (The listener is not called). The problem is: How
> do I realize that?
>
> Reason for the question: In my RCP app with a similar SWT_AWT
> bridge I cannot call the help for the view presenting this
> table. I thought it is related to the focus, but obviously
> the table behaves as if it would have focus.
I apologize, this message was intended for the SWT group.
I'm forwarding it to that group, so please reply on that
group!
Thanks,
Daniel
|
|
|
Powered by
FUDForum. Page generated in 0.04103 seconds