English 中文(简体)
lwuit container
原标题:
  • 时间:2010-02-06 10:09:16
  •  标签:
  • lwuit

I have added a container named btnBar with boxlayout(x-axis) on a form. the container has 4 buttons of custom class MyButton that extends from Button itself. When i add actionlistener to one of the buttons in the container it gets invoked for each n every button. Even the actionevent.getsource.gettext method returns the same value irrespective of the focus. I have added the buttons through an array and m trying to use is something like this:

btns[0].addActionListener(......)

Where am I going wrong?

问题回答

got is solved buddies...actually was using setfocus() to traverse within the btnBar on buttons...but needed to use setFocused() method of form too....after setFocus()....dnt hammer ur brains now....

You must never use setFocus, you should use setFocusable to toggle focusability and requestFocus to get the focus to a specific component.

You should also migrate to Codename One, since LWUIT is pretty much unmaintained.





相关问题
Custom creation of cells in a LWUIT Table in J2ME

I am trying to create a LWUIT Table in my J2ME application where all cells in one column are of a particular type e.g. TextField taking decimal input. Could anyone please suggest of achieving this or ...

Draw over camera using JAVA ME

I m wondering if there is anyway for drawing somethin over the videoControl. I tried using LWUIT but I can t achieve any result, have anybody done somethin similar? Any help will be appreciate

J2me Blackberry Numeric Input

I am developing a blackberry application using j2me and LWUIT (blackberry port). Everything works great except for the TextField in numeric mode. Basically when you have focus on the TextField you ...

Disposing a dialog in touch devices in lwuit

I am displaying a dialog when a user touches the screen and want the dialog to dispose when the user touches anywhere outside the dialog. I have set setDisposeWhenPointerOutOfBounds() to true though ...

Fail to preverify LWUIT with Antenna

I am using the LWUIT library (j2me). When I compile the code with my IDE (intelliJ) everything compiles and runs fine, but when I m building it with Antenna (latest version), I fail on the preverify ...

lwuit container

I have added a container named btnBar with boxlayout(x-axis) on a form. the container has 4 buttons of custom class MyButton that extends from Button itself. When i add actionlistener to one of the ...

java me lwuit : string does not fit on screen

i am using sun s lwuit library for making my user interface in java me. i have a string containing newline characters. this is what i do: String str = "lfjsdfsdfdkf sfljl sdfj"; TextArea box = new ...

Hide virtual keyboard for fullscreen j2me app

I developed a J2ME app using LWUIT and it works fine but when I try the app on a mobile phone with Windows Mobile 6 it displays the virtual keyboard overlapping the softkeys until I double clik it. I ...

热门标签