05-23-2012 03:48 AM
Hi all,
Im new to Blackberry java, worked on core java and android. What i need is to get the UI as shown in the image, i checked and coded but not able to achieve the correct design as shown in the image. So, can any one explain me how to do this.
05-23-2012 03:59 AM
05-23-2012 07:19 AM
Thank you simon, im able to achieve partially, when i set background for the EditText i'm not able to see the border.
05-23-2012 11:16 AM
There is an article in the knowledge base addressing this specific design:
Scrollable one-line text input field
The code you are looking for is actually in the comments section. However, I recommend you read the whole article - as an experienced Java programmer, you should have no trouble understanding the concept and tailoring it to your needs. The comments address the border requirement.
05-23-2012 11:37 AM
Hi SumiGhosh
Try this code.
import net.rim.device.api.ui.XYEdges; import net.rim.device.api.ui.component.EditField; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.container.HorizontalFieldManager; import net.rim.device.api.ui.container.MainScreen; import net.rim.device.api.ui.decor.BorderFactory; public class pkj extends MainScreen{ public pkj() { // TODO Auto-generated constructor stub HorizontalFieldManager hfm = new HorizontalFieldManager(); LabelField lbl = new LabelField("Company: "); EditField _editField = new EditField(); _editField.setBorder(BorderFactory.createBevelBord er(new XYEdges(2,2,2,2))); hfm.add(lbl); hfm.add(_editField); add(hfm); } }
Thanks
05-24-2012 12:48 AM
Hi,
You want to put that image as background the override the getPreferredWidth() and getPreferredHeight() methods in editField and return according to that image size then u can get the image like that.
Regards,
Lakshman K