how to set the position of a button in java blackberry.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can position a button or any other component on a screen by creating a
Managerclass and overriding the sublayout() method. AManageris kind of like aPanelin java i.e an area of the screen you can add components to. In the sublayout() method you shouldset the size of the component with layoutChild()
set the position of the component with setPositionChild()
Set the overall size of the Manager with setExtent()
something like
You can override getPreferredWidth() and getPreferredHeight() for your button if you want to specify a certain width and height.
See
Custom layout Manager
Manager class