Skip to main content

TextField

3 replies [Last post]
heziflash
Offline
Joined: 2008-06-03

HI

Can i connect between TextField and ActionPerformed?

Thanks,
Hezi

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
heziflash
Offline
Joined: 2008-06-03

Hi Shai

What i want is:
evry push on "FIRE" button - the _LearnHowManyCig will incrament in 1.
here is my code:
Label cig = new Label("No of cig ");
frmMain.addComponent(cig);
noOfCigTxt = new TextArea();
frmMain.addComponent( noOfCigTxt);

noOfCigTx.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent arg0) {

_LearnHowManyCig++;

}
});

P.S you don't have addActionListener for TextField , only for TextArea

Thanks
Hezi

Shai Almog

Hi Hezi,
Since text area uses the fire button to popup the edit box this won't
work well with text area.
I suggest you use the label component and set it to be receive focus
using setFocusable(true).
>
> P.S you don't have addActionListener for TextField , only for
> TextArea

Since text field derives from text area the same method will work for
both.

Thanks,
Shai.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog

Hi,
text field/area have an "addActionListener()" method.

Thanks,
Shai.

> HI
>
> Can i connect between TextField and ActionPerformed?
>
> Thanks,
> Hezi
> [Message sent by forum member 'heziflash' (heziflash)]
>
> http://forums.java.net/jive/thread.jspa?messageID=285316
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net