Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Focus and key events with SWT_AWT bridge
Focus and key events with SWT_AWT bridge [message #519924] Wed, 10 March 2010 14:20 Go to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
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 14:25 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
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
Previous Topic:Ganymede and accents
Next Topic:Project delete
Goto Forum:
  


Current Time: Fri Apr 19 11:53:14 GMT 2024

Powered by FUDForum. Page generated in 0.01975 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top