From: Claus K. on
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.
From: Claus K. on
On 1 Feb., 17:19, "Claus K." <claus.k...(a)googlemail.com> wrote:
> 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*?
From: RedGrittyBrick on
Claus K. wrote:
> 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.
From: Lew on
Claus K. wrote:
> 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.

--
Lew
From: Arne Vajhøj on
On 02-02-2010 05:46, RedGrittyBrick wrote:
> Claus K. wrote:
>> 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.

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