1. cnickl's Avatar
    OK, I�m at a complete loss. I�m somewhat experienced in programming (C# and ASP mostly) but I seem to be completely lost here.

    After much struggle I managed to install Eclipse 3.4.0 and the Eclipse plug-in to start programming (JDE and 5.0 component pack). Thank you QuiteSimple and AmigaDude for your help and advice.

    Nothing is working. The code below is a very simple program with two buttons and a label. It compiles, but when I click the �click here� button after the label is changed the program comes up with a context menu and when I close the program it comes up with the dialog �save �discard- cancel�.

    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.*;


    public class EventTest extends UiApplication
    {
    public static void main(String[] args)
    {
    EventTest theApp = new EventTest();
    theApp.enterEventDispatcher();
    }

    public EventTest()
    {
    pushScreen(new EventTestScreen());
    }
    }

    final class EventTestScreen extends MainScreen
    {
    ButtonField EventButton = new ButtonField("Click Here");
    ButtonField ResetButton = new ButtonField(" Reset ");
    VerticalFieldManager _fieldManagerTop;
    HorizontalFieldManager _fieldManagerBottom;
    LabelField _label1;

    FieldChangeListener listenToEvent = new FieldChangeListener()
    {
    public void fieldChanged(Field field, int context)
    {
    _label1.setText("CLICKED!!!");
    }
    };

    FieldChangeListener listenToReset = new FieldChangeListener()
    {
    public void fieldChanged(Field field, int context)
    {
    _label1.setText("no click");
    }
    };

    public EventTestScreen()
    {
    super();
    _fieldManagerTop = new VerticalFieldManager();
    _fieldManagerBottom = new HorizontalFieldManager();
    _label1 = new LabelField("no click");
    setTitle("Event Test");
    add(_fieldManagerTop);
    add(new SeparatorField());
    add(_fieldManagerBottom);
    _fieldManagerTop.add(_label1);
    EventButton.setChangeListener(listenToEvent);
    ResetButton.setChangeListener(listenToReset);
    _fieldManagerBottom.add(EventButton);
    _fieldManagerBottom.add(ResetButton);
    }
    }

    In addition I can�t close the simulator window when I want to stop debugging. The menu items �terminate, pause�� in the run menu in eclipse are grayed out and the only way I can end the simulator is by closing Eclipse.

    Am I doing something wrong or is there a setting in Eclipse I have to set? I�m completely lost.
    01-11-10 02:21 PM
  2. cnickl's Avatar
    OK, I need to rant for a little bit here.

    Since a few weeks I’m trying to get my feet wet in BB programming. And I find nothing but roadblocks. I installed Eclipse. Obviously it didn’t work the first time since I installed version 3.5 first. After a little search on the web I found the presumably correct version (3.4.0) and installed it. To my surprise I could NOT install the JDE from within Eclipse (following the instructions on the RIM website). It stopped telling me that it is the incorrect zip file version (???). After downloading the full installer it finally worked and I actually could install the 5.0 component pack from within Eclipse. Now the programs I write don’t work. I actually typed up part of a sample program word for word from the RIM website and it still does not do what it’s supposed to do in the simulator. And speaking of simulator. After starting to debug or run programs in the simulator I can’t stop it. The only way I can close the simulator is by exiting Eclipse or using the task manager. And when I change code in the program it does not load the updated version into the simulator. I’m getting really fed up with this. Is it because I’m running Vista? Why is there no plug-in for the newest Eclipse version? Why is the simulator apparently not connected to Eclipse properly? And what is up with the invalid zip file?
    01-11-10 05:58 PM
  3. cnickl's Avatar
    One more question. Related to my first post. I installed the RIM JDE 5.0 and it seems to work (except the fact that’s its not even close to Eclipse when it comes to user friendliness)

    I want to respond to a button event. Why does handling the event like this work:

    button1 = new ButtonField("Click Me")
    {
    protected boolean navigationClick(int status, int time)
    {
    label.setText("Clicked");
    return true;
    }
    };

    But handling it like I believe it should be:

    FieldChangeListener listen1= new FieldChangeListener()
    {
    public void fieldChanged(Field field, int context)
    {
    label.setText("Clicked");
    }
    };

    button1 = new ButtonField("Click Me");
    button1.setChangeListener(listen1);

    lead to a context menu being opened after executing and the program not exiting properly? Any help is appreciated.
    01-11-10 07:38 PM
  4. Chaoss's Avatar
    to get rid of the context menu change to
    button1 = new ButtonField("Click Me", ButtonField.CONSUME_CLICK);
    01-11-10 09:34 PM
  5. GlenB's Avatar
    I feel your pain cnickl. I think the setup of a development environment is a little complex and that is due (at least in part) by the move away from RIM's own JDE to Eclipse. The method I used to install/configure my environment was to first install the relevant JDK, add the jre_x.x.x/bin to the PATH and then install the combined Eclipse with Blackberry plugins from RIMs website. Then I installed the simulators and the component pack.

    With regard to having problems exiting the simulator - I have the same problem on Windows 7 64 bit, but not on XP 32 bit. When it occurs, I have to use task manager to end the fledge.exe process.

    Having said all that, I still installed the JDE as the sample applications are included with it and I could find them available as a seperate download.

    The documentation seems a little patchy, but the best source of information is the Blackberry Java forums -http://supportforums.blackberry.com/t5/Java-Development/bd-p/java_dev - start with the Useful Links 'sticky' thread.

    Hope this helps.
    01-12-10 08:24 AM
  6. cnickl's Avatar
    to get rid of the context menu change to
    button1 = new ButtonField("Click Me", ButtonField.CONSUME_CLICK);
    Thanks Chaoss, I will try that.

    And thanks GlenB. at least I know that I'm not the only one having issues. I'm actually using Vista 64bit. That might explain it.
    01-12-10 09:33 AM
LINK TO POST COPIED TO CLIPBOARD