How can I align the setTitle text to right/left?
Thanks
Does this do what you want?
RichTextField rtf1 = new RichTextField("Right-aligned plain", RichTextField.TEXT_ALIGN_RIGHT);
RichTextField rtf2 = new RichTextField("Centered extra bold", RichTextField.TEXT_ALIGN_HCENTER);
RichTextField rtf3 = new RichTextField("Left-aligned italic", RichTextField.TEXT_ALIGN_LEFT);
From this post.
Or this post...
Related
How do I make my texfield caption to the left of the text box instead of defaulting on top of it?
HorizontalLayout hLayout = new HorizontalLayout();
setConent(hLayout);
TextField tf = new TextField();
hLayout.addComponent(tf);
Either way use FormLayout to wrap every TextBox as suggested in comments, or you have to alter the css of your TextBox. Set style to your TextBox to only apply this to those you want.
TextBox yourTextBox = new TextBox();
yourTextBox.addStyleName("inline-label");
then the css would look like this:
.v-caption-inline-label{
display: inline-block;
}
Why not do it this way:
final FormLayout form = new FormLayout();
form.addComponent(new TextField("Caption line 1"));
final HorizontalLayout formLine2 = new HorizontalLayout();
formLine2.addComponents(new TextField(), new Button(), new Button());
formLine2.setCaption("Caption line 2");
The text field in line 1 has the caption left.
The text field in line 2 would have the caption on top due to the horizontal layout container. By moving the caption from the text field to the horizontal layout, the caption will be on the left side again.
Hi i just have an EditField instance that i created this way:
EditField editField = new EditField("Name", "");
But it shows that there is no space between the label "Name" and the edit Field (fill form). I want to define a specific space between them but i wonder how to do it.
just give how much space u want in "name" as "name " like this
EditField editField = new EditField("Name : ", "");
I trying to set rounded border for Blackberry Bitmap field.But it is not working for me.
I overriding paint method of Bitmap field.
g.drawRoundRect(0,0,HomeScreenIcons.barcode.getWidth(),HomeScreenIcons.barcode.getHeight(), 10, 10);
How can i set Border for Bitmap field in Blackberry.
You can give a try this way:
BitmapField bitf = new BitmapField();
bitf.setBorder(BorderFactory.createRoundedBorder(new XYEdges(6,6,6,6)));
Hope this helps...
Hi friends I am using LabelFields to display text message in a screen i want different fonts each LabelField but when i am using api fonts of blackberry using
FontFamily fontFamily[] = FontFamily.getFontFamilies();
Font font2 = fontFamily[0].getFont(FontFamily.SFF4_FONT,18);
is showing bold style how to use different font styles plz help me
try this
FontFamily alphaSerifFamily = FontFamily.forName("BBAlpha Serif");
Font appFont = alphaSerifFamily.getFont(Font.PLAIN,7,Ui.UNITS_pt);
LabelField lb = new LabelField("Test");
lb.setFont(appFont);
I am having the following code snippet in my application screen to show a label text in some bigger and good font. It looks good to me. But i also want to make this font to "bold" as well. Currently it doesn't show in boldfont as well. Could someone guide me how can i provide the label field text with the same font but also with bold ??? (or) Please tell me how can i make the label text with any other bigger size(24) font with bold?
LabelField subTitleLabel = new LabelField ("My App Sub Title", LabelField.FIELD_LEFT);
final FontFamily fontFamily[] = FontFamily.getFontFamilies();
final Font font10 = fontFamily[1].getFont(FontFamily.CBTF_FONT, 24);
subTitleLabel.setFont(font10);
subTitleLabel.setMargin(25, 0, 0, 10);
horEventFldManager.add(subTitleLabel);
This assumes that subTitleLabel is already set to the font that you want. It is just resetting it to a Bold version of that font.
subTitleLabel.setFont(subTitleLabel.getFont().derive(Font.BOLD));