Skip to main content

CheckBox - how do I get an event when its ticked?

1 reply [Last post]
68060
Offline
Joined: 2011-08-29

Im not sure theres much point in this forum since no one ever replies, but ill keep on trying :-)

IN LWUIT 1.5 in the gui editor, if you lay a check box then click on it -> events -> action event -> it takes you to a method that should be called when it is clicked but this never happens, any reason or is it a bug? do i have to register a listener somewhere?

ok you can manually do it like this:

usetemplatecb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
_("Tickbox toggled.");
}
});

but i found out if you do it on postshow it works, i was doing it too early..

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

If you have a command associated with the component the command will occur instead of the action event which is somewhat annoying (I've been wracking my brain about this for a while now). Unless you changed the name of the method it should be invoked when you tick the checkbox when running the application via Netbeans.