java me - Button field(using image as button) focus issue -
in single row displaying text field enter search text along search image button field. below of row displaying list of names.
the issue here is, image button field not getting focus during downward movement of keyboard arrow keys. during upward movement getting focus when click left arrow. downward movement not getting focus arrow movement.
text field enter search text:
final textfield tfteamsearch = new textfield(); tfteamsearch.setfocus(true); image button field:
btnsearchimage = new button(); btnsearchimage.seticon(imgsearchunfocus); btnsearchimage.getstyle().setbgtransparency(0); btnsearchimage.getstyle().setborder(null); btnsearchimage.getstyle().setfont(font); btnsearchimage.getselectedstyle().setfont(font); btnsearchimage.getpressedstyle().setfont(font); btnsearchimage.getunselectedstyle().setfont(font); btnsearchimage.setfocusable(true); could u please me how set focus both upward , downward movement using arrow keys?
firstly: should use tfteamsearch.requestfocus() instead of tfteamsearch.setfocus(true) if desire set focus textfield. tfteamsearch.setfocus(true) changes style.
secondly: can use component methods setnextfocusdown, setnextfocusup, setnextfocusleft or setnextfocusright setting next component under focus.
Comments
Post a Comment