SWT: TextField ModifyListener

C

Claus K.

Hello everyone,

quick question:

If I have two text fields and want to clear the text of one when there
is a ModifyEvent on the other one, I do the following:

public class OrderModifyListener implements ModifyListener
{
MainWindow mainWindow;

public OrderModifyListener(MainWindow window)
{
mainWindow = window;
}

public void modifyText(ModifyEvent e)
{
if (!(mainWindow.getQualifierField().getText().equals("")))
{
mainWindow.getQualifierField().setText("");
}
}
}


The following is happening:

If there is text in the Qualifierfield, it is being cleared, BUT the
character typed in the textfield listening to the event gets lost. All
further typed characters are being entered properly.

To me, this appears as if the keyup event which should insert the
character is being lost when the modify event is being caught.

What am I doing wrong? I could of course just implement a KeyListener
and catch the keyup event, but I am interested as to how this is done
the right way.
 
C

Claus K.

Hello everyone,

quick question:

If I have two text fields and want to clear the text of one when there
is a ModifyEvent on the other one, I do the following:

public class OrderModifyListener implements ModifyListener
{
        MainWindow mainWindow;

        public OrderModifyListener(MainWindow window)
        {
                mainWindow = window;
        }

        public void modifyText(ModifyEvent e)
        {
                if (!(mainWindow.getQualifierField().getText().equals("")))
                {
                        mainWindow.getQualifierField().setText("");
                }
        }

}

The following is happening:

If there is text in the Qualifierfield, it is being cleared, BUT the
character typed in the textfield listening to the event gets lost. All
further typed characters are being entered properly.

To me, this appears as if the keyup event which should insert the
character is being lost when the modify event is being caught.

What am I doing wrong? I could of course just implement a KeyListener
and catch the keyup event, but I am interested as to how this is done
the right way.

A further question, are there mailing lists for SWT instead of the
*dev one, where I simply do not belong to as *SWT-User*?
 
R

RedGrittyBrick

Claus said:
A further question, are there mailing lists for SWT instead of the
*dev one, where I simply do not belong to as *SWT-User*?

SWT questions are rare in CLJP compared to Swing or EE questions. I
conclude that either there are few SWT programmers or that they have all
found somewhere else to discuss SWT.

You could have a look in stackoverflow.com.
 
L

Lew

Claus said:
A further question, are there mailing lists for SWT instead of the
*dev one, where I simply do not belong to as *SWT-User*?

Are you sure? All users of SWT as such are developers so I'd expect that
group to be at least nominally appropriate.

Regardless, I'd say your odds of finding competent coders of SWT are best
right here in clj.programmer.
 
A

Arne Vajhøj

SWT questions are rare in CLJP compared to Swing or EE questions. I
conclude that either there are few SWT programmers or that they have all
found somewhere else to discuss SWT.

You could have a look in stackoverflow.com.

Fat client Java GUI's are not that common compared to the
Java EE web GUI's. And Swing is more widely used than SWT.

But SWT is stil on topic here (or maybe even more in
comp.lang.java.gui).

Arne
 
A

Arne Vajhøj

Are you sure? All users of SWT as such are developers so I'd expect that
group to be at least nominally appropriate.

If the SWT mailing lists are like those often are then developers
using SWT should use the "user" while developers working on SWT
itself should use the "dev".
Regardless, I'd say your odds of finding competent coders of SWT are
best right here in clj.programmer.

Yep.

No one here is biting.

At least not hard.

:)

Arne
 
C

Claus K.

If the SWT mailing lists are like those often are then developers
using SWT should use the "user" while developers working on SWT
itself should use the "dev".


Yep.

No one here is biting.

At least not hard.

:)

As long as they only do so when asked for ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,771
Messages
2,569,587
Members
45,099
Latest member
AmbrosePri
Top