0

I ma new to BB development. I have a field manager defined and set like:

horizontalField= new HorizontalFieldManager(Manager.USE_ALL_WIDTH);
setStatus(horizontalField); 

I have a button and a checkbox

CheckboxField chkBuffer=new CheckboxField("Buffer" ,true);

ButtonField sendButton=new ButtonField("Send")

When I try to add these to the horizontal FM, only check box appears and the button is not visible for some reason. I add them like

 horizontalField.add(chkBuffer);

 horizontalField.add(sendButton);

Any ideas about what can be going wrong ?

Cemre Mengü
  • 18,062
  • 27
  • 111
  • 169

2 Answers2

1

This will also help you and is easy too:

horizontalField.add(chkBuffer);

sendButton.setMargin(0, 0, 0, Display.getWidth()-chkBuffer.getPreferredWidth()-sendButton.getPreferredWidth());

horizontalField.add(sendButton);

Take a look at this also.

Community
  • 1
  • 1
Atif Imran
  • 1,899
  • 2
  • 18
  • 33
0

try this -

  final CheckboxField chk=new CheckboxField(){
        protected void layout(int width, int height) {
            super.layout(25, 20);
        }
    };
Rince Thomas
  • 4,158
  • 5
  • 25
  • 44