Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with focuslost(Problem with focuslost)
Problem with focuslost [message #634395] Thu, 21 October 2010 14:37 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: October 2010
Junior Member
Hi everybody, i'm having trouble with this code:

import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.SWT;

public class wdw
public static void main(String[] args) {
Display dis = new Display();
final Shell s = new Shell(dis);
s.setLayout(new GridLayout(1, false));
s.setSize(300, 200);
Text t1=new Text(s, SWT.BORDER);

Text t2=new Text(s, SWT.BORDER);

final FocusListener listener = new FocusListener() {
public void focusGained(FocusEvent event) { }
public void focusLost(FocusEvent event) {
MessageBox msgBox = new MessageBox(s, SWT.ICON_INFORMATION|SWT.OK);
msgBox.setMessage("focus lost");
msgBox.setText("Focus lost");;

while (!s.isDisposed()) {
if (!dis.readAndDispatch())

after focuslost event in t1 when I click on OK button in message box the control return to t2 widget but is impossible to write in it.
Is it a swt bug?

Thanks in advance
Re: Problem with focuslost [message #634554 is a reply to message #634395] Fri, 22 October 2010 08:30 Go to previous message
Lakshmi ShanmugamFriend
Messages: 276
Registered: July 2009
Location: India
Senior Member

I can reproduce this, but doesn't happen always.
I noticed that after clicking OK, when the mouse is moved over the shell, mouse cursor sometimes changes to ibeam instead of arrow. When you click on the shell or textbox so that the arrow cursor appears, you can start typing again.

This looks like a bug to me. Can you please open a bug report under SWT --> &component=SWT


Lakshmi P Shanmugam
Previous Topic:Adding mouse down listener to chevron item in CTabFolder
Next Topic:Text vertical scrollbar not usable on Mac
Goto Forum:

Current Time: Thu Dec 12 23:32:21 GMT 2019

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

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

Back to the top