Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Carrier: relience
Accepted Solution

Issue of verticalfieldmanager with the LableField

[ Edited ]

Hello,

 

I am developing my first blackberry application.

But I am stuck with the VerticalField and the lable field.

I want to build one UI but I am not able to implement it.

 

8900-01.png

 

In this the text should be scrollable and in bottom check box of accept terms and Two buttons in the bottom.

Pls guide me to implement this view.

 

Thanks in advance,

bskania

Please use plain text.
Developer
simon_hain
Posts: 15,558
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Issue of verticalfieldmanager with the LableField

a labelfield is not scrollable as scrolling is a function of focus handling, and the whole field gets the focus.
you can use a richtextfield instead, for example, or implement custom scrolling. search the forum for more solutions.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Trusted Contributor
Himanshu_berry
Posts: 138
Registered: ‎04-19-2012
My Carrier: Nokia

Re: Issue of verticalfieldmanager with the LableField

[ Edited ]

post your code.

and explain what u want.

Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Carrier: relience

Re: Issue of verticalfieldmanager with the LableField

[ Edited ]

I had done it this way. but its not showing properly in all the device.

 

public GetNewPin() {
// TODO Auto-generated constructor stub
super(Manager.NO_VERTICAL_SCROLLBAR | Manager.NO_VERTICAL_SCROLL
| Manager.USE_ALL_HEIGHT);
setTitle(new CustomTitleBar("MY APP"));
// getMainManager().setBackground(
// BackgroundFactory.createSolidBackground(Color.AZURE));

VerticalFieldManager _main_screen = new VerticalFieldManager(
Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR
| Manager.USE_ALL_HEIGHT) {
protected void paint(Graphics graphics) {
graphics.setBackgroundColor(Color.BISQUE);
graphics.clear();
super.paint(graphics);
};

};
LabelField _title = new LabelField("TITLE?", LabelField.FIELD_HCENTER);
SeparatorField sf = new SeparatorField();
// add UI components to Pop-up screen
_main_screen.add(_title);
_main_screen.add(sf);

VerticalFieldManager _vfm_txt_message = new VerticalFieldManager(
VERTICAL_SCROLL) {
protected void sublayout(int maxWidth, int maxHeight) {
// TODO Auto-generated method stub
super.sublayout(maxWidth, maxHeight - 70);
}
};
_vfm_txt_message.setVerticalScroll(0);
LabelField _txtMessage = new LabelField(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged."
+ CommonFunctions._msg_cost + ".", LabelField.FOCUSABLE) {
protected void paint(Graphics graphics) {
// TODO Auto-generated method stub

int[] X_PTS = new int[] { 0, getWidth(), getWidth(), 0 };
int[] Y_PTS = { 0, 0, getHeight(), getHeight() };
if (isFocus()) {
int[] drawFocusColors = new int[] { 0xededed, 0xededed,
0xededed, 0xededed };
graphics.drawShadedFilledPath(X_PTS, Y_PTS, null,
drawFocusColors, null);
}
super.paint(graphics);
}
};

_vfm_txt_message.add(_txtMessage);
_main_screen.add(_vfm_txt_message);
SeparatorField sf1 = new SeparatorField();
_main_screen.add(sf1);
final CheckboxField cbf1 = new CheckboxField(" Accept Terms", true,
FIELD_BOTTOM);
_main_screen.add(cbf1);
HorizontalFieldManager hfm = new HorizontalFieldManager(
VerticalFieldManager.FIELD_HCENTER | FIELD_BOTTOM
| USE_ALL_HEIGHT);

bf1.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
// TODO Auto-generated method stub

}
});
bf2.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
// TODO Auto-generated method stub
close();
}
});
hfm.add(bf1);
hfm.add(bf2);
_main_screen.add(hfm);
add(_main_screen);

}

Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Carrier: relience

Re: Issue of verticalfieldmanager with the LableField

I want exact view as displayed in image. But the text can be scrollable in its area.
Please use plain text.
Trusted Contributor
Himanshu_berry
Posts: 138
Registered: ‎04-19-2012
My Carrier: Nokia

Re: Issue of verticalfieldmanager with the LableField

[ Edited ]

add VERTICAL_SCROLLBAR

 

 

OR wait i m trying.

 

actully your image is not displayed.

Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Carrier: relience

Re: Issue of verticalfieldmanager with the LableField

I can view that image if I am not login to the forum. Are you able to see it?

I tried with Vertical_Scrolbar property but its giving me JVM error.

Please use plain text.
Trusted Contributor
Himanshu_berry
Posts: 138
Registered: ‎04-19-2012
My Carrier: Nokia

Re: Issue of verticalfieldmanager with the LableField

9860.jpg

i can not see your image ..i think u want this little bit.

Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Carrier: relience

Re: Issue of verticalfieldmanager with the LableField

Actually its under waiting for approval. So Please answer me after it is visible to you.
Please use plain text.
Trusted Contributor
Himanshu_berry
Posts: 138
Registered: ‎04-19-2012
My Carrier: Nokia

Re: Issue of verticalfieldmanager with the LableField

have u seen my screen which i post.

Please use plain text.