Question

I am using LWUIT package for my j2me application.In my application, i have extends Component class and then draw strings on the component.Now i want to get the key code and then draw string on the component based on the key pressed.how do i know which key is pressed in LWUIT? I want to capture key press event on LWUIT and draw strings on screen.Is this possible in LWUIT?

Is there any way to draw strings on screen without using Component in LWUIT?

Was it helpful?

Solution

You can add a label to a container which is normally how we do things in LWUIT and use the component based UI (see our demos).

You can override keyReleased and do your event handling there, but your component needs to be focusable to receive key events. Alternatively you can bind a key listener to the form or override the forms key callback methods.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top