Skip to main content

Add action listener to a container

1 reply [Last post]
stern23
Offline
Joined: 2010-10-29
Points: 0

Hello,
I want to create a specific button which has two part of text, left and right..
So I need to use Grid layout (new GridLayout(1,2) )
But because I can't do it in a button , I created my own component which extends Container and set its layout to grid and set it Focusable as well.
For now everthing were as expected... but the problem it's not responding to any event because i can't set action listener !!
is any way to apply that?

Thank you

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
Points: 0

If you are using SVN you can use LeadComponent:
http://lwuit.blogspot.com/2011/01/lwuit-resource-editor-tutorial-part-10...
Otherwise you need to define the parent as focusable and remove focusability from the child, then handle all events on your own. Its relatively easy to implement though.