Skip to main content

How to set command listner for specific label

1 reply [Last post]
sanchitgupta
Offline
Joined: 2010-04-18

Hi,

I am creating a Java ME applictaion with help of LWUIT. I have to associate each label with a particular command. Please help me. I am a beginner in mobile programming.

Thanks in Advance
Sanchit

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
shankar_vn
Offline
Joined: 2009-11-03

use buttons instead of labels if you really want to do something on clicking of it.
[code]
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
//do the stuff
}
}
[/code]
labels are used to show text/image, and buttons for interacting with user.