1. pckozub's Avatar
    I've been doing java for a couple years now and I can play nice with Swing. In Swing, when you want to handle a button event, you create your button, add it to the container, set the event handler to "this", and create the method to handle it...but in RIM's ButtonField APIs it looks a little more complicated.

    Can anybody post some source code to handle a button click event? I'm really dedicated to learning this stuff, but thus far I haven't been able to find much to look at in the way of source code. It would be much appreciated.

    Thanks,
    Patrick
    03-06-09 09:04 AM
  2. ydaraishy's Avatar
    Go look up the FieldChangedListener API.

    There's an example in the documents: BlackBerry JDE 4.7.0 API Reference: Class ButtonField (the API links to RIM's site seem broken?)
    03-06-09 05:52 PM
  3. pckozub's Avatar
    Thank you; I will look at that. Yeah, the API links are a little hard to find...I'm still looking
    03-08-09 05:42 PM
  4. dinyberry's Avatar
    once u got the link post it
    04-06-11 06:18 AM
  5. AcADIeN's Avatar
    ButtonField btnScan = new ButtonField("Scan", ButtonField.CONSUME_CLICK | ButtonField.NEVER_DIRTY | Field.FIELD_HCENTER | Field.FIELD_VCENTER);

    btnScan.setChangeListener(new FieldChangeListener()
    {
    public void fieldChanged(Field field, int context)
    {
    //runstuffhere
    }
    });

    add(btnScan);

    here and example for my button scan on qrthis scanner
    04-14-11 02:53 PM
LINK TO POST COPIED TO CLIPBOARD