ObjectChoiceField problem

Hello

When I designed the user interface, I used the ObjectChoiceField. The code is as follows:

String choice [] = new String [7];
       
choice [0] = "Mon";
choice [1] = "Tuesday";
choice [2] = 'Sea.';
choice [3] = "SAT.";
choices [4] = "Friday";
choice [5] = "Sat.";
choice [6] = "Sun";
       
cfDay = new ObjectChoiceField ("day:", choice, 0);

But I think the legend 'Day' is very far from the era, like MON or Tues...

That's why a big void between the legend and the actual data.

How to remove the cache between them?

Thank you

Jerry

cfDay = new ObjectChoiceField ("day:", choice, 0, ObjectChoiceField.FIELD_LEFT);

Tags: BlackBerry Developers

Similar Questions

  • ObjectChoiceField FieldChangeListener problem

    Hi all

    I'm coding an application for 4.5 but testing on BB 9500.

    I want to a few call webservice on the choice of an ObjectChoiceField.

    But the problem is that the FieldChangeListener of the ObjectChoiceField fires on the development as well as on the selection of the field.

    How to distinguish two event?

    Thaks for your help in advance.

    Hi all

    I found the solution to my problem.

    Below is sample code for the solution.

    ObjectChoiceField myObjectField= new ObjectChoiceField("",new String[] { "" }, 0, FIELD_LEFT)
    {
        protected void fieldChangeNotify(int context)
        {
        new myObjectField_change_method();
        }
        public void focusChangeNotify(int arg0)
        {
        super.focusChangeNotify(arg0);
        }
    };
    

    In the code above myObjectField_change_method() is a method to be triggered when the field is selected.

  • problem with my screen and ObjectChoiceField, help!

    Hi, I have a screen where there are two objectChoiceField. I want to make is that, according to the value that we chose in the first objectChoiceField, the second objectChoiceField also selectable values change. I tried in the trackwheelclick, change the first objectChoiceField, repaint the screen with the choice in this election and that option objectChoiceField the second change, but I don't not do, what am I doing wrong? Thanks in advance and sorry for my English, this is my code:

    public class MovimientoInvScreen extends MainScreen{
    
        private InformesController controller;
    
        private HorizontalFieldManager containerHoriz;
    
        private RoundRectContainer containerDatosEco;
        private RoundRectContainer containerDatosRRHH;
        private RoundRectContainer containerInfoAmpli;
    
        private GridFieldManager containerGridEco;
        private GridFieldManager containerGridRRHH;
        private GridFieldManager containerGridInfoAmpli;
    
        private ButtonField buttonMover;
    
        private BasicEditField codigo;
        private ObjectChoiceField boxProv;
        private ObjectChoiceField boxCentro;
    
        private CentroDTO centro;
        private KeyValue provincia;
        private Vector centros;
        private KeyValue provinciaActual;
    
        public MovimientoInvScreen(InformesController controller) throws Exception{
    
            this.controller = controller;
            controller.obtenerDetallesCentro();
    
            centro = controller.getCentroSeleccionado();
    
            provincia = controller.getProvinciaSeleccionada();
    
            setTitle("Mov. inventario " + centro.getNombre());
    
            containerHoriz = new HorizontalFieldManager();
    
            String choiceProv[] = {"Almería", "Cádiz", "Córdoba", "Granada", "Huelva", "Jaen", "Málaga", "Sevilla"};
            boxProv = new ObjectChoiceField ("Provincia",choiceProv, provincia.getDescripcion());
    
            centros = controller.obtenerCentrosProvincia(provincia.getId());
            Object choiceCentro[] = new Object [centros.size()];
    
            for (int i=0; i< centros.size(); i++){
                choiceCentro[i] = centros.elementAt(i);
            }
    
            boxCentro = new ObjectChoiceField ("Centro de destino", choiceCentro);
    
            codigo = new BasicEditField("Activo                                      ",
                    "", 10,    BasicEditField.FILTER_NUMERIC | Field.FOCUSABLE);
    
            buttonMover = new ButtonField("Mover", Field.FIELD_HCENTER);
    
            add(boxProv);
            add(boxCentro);
            add(codigo);
    //        add(buttonCamara);
            add(buttonMover);
        }
    
        protected void makeMenu(Menu menu, int instance) {
    
            super.makeMenu(menu, instance);
        }
    
        protected boolean trackwheelClick(int status, int time) {
    
            try{
    
                if(boxProv.isDirty()){
    
                    provinciaActual = ((KeyValue) boxProv.getChoice(boxProv.getSelectedIndex()));
                    if (provincia != provinciaActual){
    
                        boxProv.setDirty(false);
                        this.controller.setProvinciaSeleccionada(provinciaActual);
    
                        UiApplication.getUiApplication().popScreen(MovimientoInvScreen.this);
                        UiApplication.getUiApplication().pushScreen(new MovimientoInvScreen(this.controller));
                    }
    
            }catch(Exception e){
                Dialog.inform(e.getMessage());
            }
            return super.trackwheelClick(status, time);
        }
    
        public boolean onClose() {
            int i = Dialog.ask(Dialog.D_YES_NO, "¿Desea cerrar la aplicación?");
            if (i == Dialog.YES)
                System.exit(0);
    
            return true;
        }
    
        protected boolean keyChar(char key, int arg1, int arg2) {
            if(key == Characters.ESCAPE){
                UiApplication.getUiApplication().popScreen(MovimientoInvScreen.this);
                return true;
            }else
                return super.keyChar(key, arg1, arg2);
        }
    }
    

    I think that the example code provided by Dmitry is more complex that it must be to demonstrate this link.  I hope that the following code is easier to understand.

    import net.rim.device.api.i18n.*;
    import net.rim.device.api.system.*;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    
    public class ObjectChoiceFieldTestScreen extends MainScreen
                                             implements FieldChangeListener {
    
        static String [] COUNTRIES = new String [] { "England", "US", "Canade" };
        static String [] ENGLAND_CITIES = new String [] { "London", "Liverpool" };
        static String [] US_CITIES = new String [] { "New York", "Washington", "Boston", "San Francisco" };
        static String [] CANADA_CITIES = new String [] { "Montreal", "Toronto", "Vancouver" };
        ObjectChoiceField _countryChoice = new ObjectChoiceField("Select Country:", COUNTRIES);
        ObjectChoiceField _cityChoice = new ObjectChoiceField("Select City:", null);
    
        public ObjectChoiceFieldTestScreen() {
            super();
            this.setTitle("Test ObjectChoiceField Linking");
            this.add(_countryChoice);;
            _countryChoice.setSelectedIndex(1);
            fieldChanged(_countryChoice, 0); // This just simulates the first 'setting' of the choice
            _countryChoice.setChangeListener(this);
            this.add(_cityChoice);
    
        }
    
        public void fieldChanged(Field f, int context) {
            if ( f != _countryChoice ) {
                return;
            }
            int countryIndex = _countryChoice.getSelectedIndex();
            if ( countryIndex == 0 ) {
                _cityChoice.setChoices(ENGLAND_CITIES);
            } else
            if ( countryIndex == 1 ) {
                _cityChoice.setChoices(US_CITIES);
            } else {
                _cityChoice.setChoices(CANADA_CITIES);
            }
        }
    }
    

    This illustrates the connection but hides a problem.  Changing the initial index of 1 (US) to 0 (England) and see what happens to the width of the field of cities.  There is a way around that.  But let's get the first sorted sequence.

  • Strange: Objectchoicefield and ObjectListField in Gridfieldmanager - navigation problem

    Hi @all,

    I have a very strange problem, because running Simulator runs as I would have liked, but the device, the navigation is bad:

    running OS 5.0.0.42 3 on device (BB9700) and the Simulator

    1. the building screen

    2. put verticalfieldmanager on it that contains the background image

    3. put gridscreenmanager (with a column - the problem is with more then one column, too) on the first position of the vfm

    4. turn objectchoicefield with 5 points on the 1st row of the gsm

    5. put the objectlistfield with 5 points on the second line of gsm

    Program running in the Simulator:

    View all as I prefer.

    The first objectchoicefield and beyond the objectlistfield.

    When I scroll with trackpad OCF Gets the focus first and after that the olf on its first line.

    I can scroll up and down, and everything's fine.

    Program running on the device:

    View all as I prefer.

    The first objectchoicefield and beyond the objectlistfield.

    When I scroll with trackpad OCF Gets the focus first and after that the olf on its first line.

    So far so good:

    When I scroll down to the olf, all things are working properly. For example, point 4 a now focus.

    Now, if I try to go back in the OLF, it should go back to article 3 of the olf, but this is the leap into objectchoicefield. After that, if I try to go back to the objectlistfield, it jumps directly to point 4, which he came before.

    If I don't put the objectchoicefield in the first row, everything works fine.

    What can I do?

    I did something wrong?

    All ideas are very appeciated.

    Thanks in advance.

    CUA

    Michael

    Well, I found it.

    I made a mistake in the application of my own gridfieldmanager navigationmovement method.

    What is already strange: I used the same gridfieldmanager within 2 screens in my application. First screen was working fine, the second one was bad. Same content in both screens.

    Sorry for that.

    Thank you for all.

    CUA

    Michael

  • ObjectChoiceField layout problem

    Hi friends,

    I'm putting an ObjectChoiceField on the 8900 4.6.1 OS version and the rect of the field is not shown.

    5.0 Os version works quite well.

    below the picture on 4.6.1...  The two fields are editable ObjectChoiceFields.

    Note: the functtionality is correct only visual is not good in 4.6.1.

    Thank you all.

    It is a behavior of OS version, I realized. The solution was to implement a custom choicefield.

  • Problem with ObjectChoiceField

    Hi friends,

    I created a choice of object field and I try to load the values into this field of choice of object during execution. What I did, I used (setchoice) method to set a value to a time of execution. I can get the values of what I put in execution but the problem I m facing is, if we go after the last element in the choice of subject field it will be thanks to a special null pointer and his watch is not the first element of the array. Can U help pls how to overcome this problem and pls tell no matter what happens, the reason for this problem...

    Kind regards

    s.Kumaran.

    Ooops... It was a mistake to programming baisc. glad you figured it out. You can mark the thread as solved.

  • ObjectChoiceField.setChoice () - screen problem


    Solved.  Had with the field is not unable to "gracefully" to handle a null value in the [(see loop for).

  • problem compiling under JDE 4.6

    I got this error when compile my project 4.3 to 4.6

    C:\Program Research In Motion\BlackBerry JDE 4.3.0\samples\com\rim\samples\device\TestApp\DialScreen.java:159: cannot access net.rim.device.api.ui.component.ListFieldMeasureCallback
    file not found net\rim\device\api\ui\component\ListFieldMeasureCallback.class
    private class MyObjectListField extends ObjectListField {}

    This error can be triggered by the expansion of some areas such as the ObjectChoiceField.  We are aware of this problem and it was reported to our development team.

  • ObjectChoiceField.getContextMenu () .getDefaultItem () .run () not working OS 5.0

    Hello
    I have an application that works well with the OS 4.6.247, but with the 5.0 OS, I have a problem with the function ObjectChoiceField.getContextMenu () .getDefaultItem () .run ().

    Is to throw NullPointerException.

    The code is the same on OS4.6 and OS 5.0

    Any idea?

    Thank you

    Everything is OK with:

    SerializableAttribute public class MyObjectChoiceField extends ObjectChoiceField {}
    Private boolean _IsFocusable;
    public MyObjectChoiceField() {}
    Super();
    }
    public MyObjectChoiceField (String Label, Object [], int InitialIndex, long Style) {}
    Super (label, Choices, InitialIndex, style);
    }
    public boolean isFocusable() {}
    Return _IsFocusable;
    }
    public void SetFocusable (boolean Focusable) {}
    _IsFocusable = active;
    }
    public void ShowContextMenu() {}
    invokeAction (Field.ACTION_INVOKE);
    }
    }

  • ObjectChoiceField

    Hello

    I have used described as follows:

    class Employee
    {
    int _Eid;
    int _Ename;
    public Employee(){}
    }
    

    Now let's say I want to create a list of employees with the ID and fill in a drop down list of 'ObjectChoiceField '... What is the best way to do it?

    When the user selects "Rob" in the menu dropdown, I should be able to determine "_Eid" of Rob.

    Can I do this?

    If the list will change, then a BigVector is a good idea.

    But you don't have to extract them in a table because the ObjectChoiceField requires a range of choices, not a BigVector of choice.

    What I usually do in this situation sot is initially put the data in a vector during the processing of the download, and then copy the vector in a table as soon as we roughly fixed list.

    People say things are dynamic, but they do not change every second, you have to do something, like stuff from the user interface of the process and thus convert the vector table collection (or BigVector) and back is not a big problem.  See also Arrays class - there are a lot of utilities such as the binary search and sort who also help.

    The Compariator is actually nothing to be frigthened of.  In your case, you will create a new class that extends the object and implements the required method.  You can actually have a number of different compariators.  Here's a quick example to help you get started.

    class EmployeeComparator implements comparator
    {

    public int compare (Object o1, Object o2) {}

    If (instanceof employee o1 & o2 instanceof employee) {}

    Employee e1 = o1 (employee);

    Employee e2 = o2 (employee);

    int compareValue = ei._Ename.compareTo (e2._Ename);

    If (compareValue == 0) {}

    name is the same, the id?

    compareValue = e1._Eid - e2._Eid;

    }

    CompareValue return;

    }

    return 0; No employees!

    }

    }

  • How to stop the ObjectChoiceField prompt you to save the window?

    Hi, I have 3 ObjectChoiceFields in my code to let the user select the information, then it passes the value to the next screen again. However when I click on the back button to return to the previous screen and exit the application, he always invites a window of notice asking me if I want to save, delete, or cancel. If I click on save, and then run the code again, the ObjectChoiceFields still shows the original value, if the backup does not really work. I would like to know how to do the backup works, so that the next time I run the code, it will present the values I chose last time. or another solution, how can I stop ObjectChoiceField prompt you to save the window?

    Thank you very much!

    Hello

    There are two ways to do this (assuming that the judgment save prompt will solve the problem)

    1.

    In the api using onSavePromptMethod();

    This method is a member of the screen class (AFAIK). You can override this and simply return true;

    Who can't let the application display quick check

    2.

    First, use this code in the onClose method

    If (getMainManager () .isDirty ()) {}
    getMainManager () .setDirty (false);
    }

    I found that 2 still works and uncertain about 1. But I prefer to use 1 and you asking to try that and tell if it worked on the side or not...

  • Weird ObjectChoiceField in OptionsProvider

    I don't really know if it is related to the OptionsProvider, but here is the screen with the problem (labels wrapped):

    I have several ObjectChoiceField- s, added to the screen, and when I open it first time in the application I see that.

    The next time or when I opened this page of third... everything looks OK.

    It is interesting when it happens in 7.0 + and is not in 6.0

    All the fields have been created as:

    new ObjectChoiceField("Homesceen Icon" , new String[] { "On", "Off" } , 0);new ObjectChoiceField("Update Frequency" , new String[] { "30 minutes", " 15 minutes ",  "10 minutes"  } , 0);
    

    OK, if someone is interested, to fix it i:

    1 created horizontal custom Manager,

    2 put LabelField and ObjectChoiceFiled with empty label

    3. in sublayout method defined calculated positions and extensions of these objects.

    It works as it should now.

    I guess that, OS 7.0 introduced a bug in ObjectChoiceField.

  • DateField, HorizontalFieldManager + ObjectChoiceField = error

    I am creating a page layout so that there a datefield and objectchoicefield in the horizontalfieldmanger even, and it throws me illegalarguementexception every time. Can someone help me? Here is the code example.

    HFM HorizontalFieldManager = new HorizontalFieldManager();
    HFM. Add (new DateField ("Some Text:", Date () .getTime (new),))
    DateFormat.getInstance (DateFormat.TIME_DEFAULT)));

    HFM. Add (new ObjectChoiceField ("", new String [] {"some", "text"}));
    Add (HFM);

    The problem here is that the DateField occupies the entire width.  The ObjectChoiceField then try to deal itself.  He seems to be referring to the treatment of layout of a RichTextField and pass the width that it must work, and the string to be converted (in this case, it is "a little").  RichTextField barfs with an Exception, because there is no way that 'some' can fit in the space provided (-1 pixel).

    To get this working, you have to find a way to limit bandwidth claiming the DateField.  I thought you'd be able to do by indicating the field to put his time left (style == DateField.FIELD_LEFT, but which did not work, so I went back to my usual substitutions and created what follows, that works.)

    You can take it from here?

    HFM HorizontalFieldManager = new HorizontalFieldManager();
    HFM. Add (new DateField ("Some Text:", System.currentTimeMillis (),))
    {DateFormat.getInstance (DateFormat.TIME_DEFAULT))}
    public int getPreferredWidth() {}
    Return to 150;
    }
    Protected Sub layout (int width, int height) {}
    Super.Layout (getPreferredWidth (), height);
    }
    });
    HFM. Add (new ObjectChoiceField ("", new String [] {"some", "text"}));
    Add (HFM);

  • How to remove a Custom DDL or ObjectChoiceField

    Hi all

    I am doing a shopping basket sort of thing...! for this I need to change the dropdownlists dynamically on the selection.

    !) When the user selects the button category, main ddl should be updated.

    (2) when the user selects a subacaegory of DOF, DOF sub must be courses.

    I realized this some how... dynamically, I changed the reference to the ddl and updated. It works fine but the problem is, when an another DOF makes its appearance the previous is there remain only and a new is overwhelming at this point. as a result when the width of the new ddl is lower than the previous ddl, it appeared in her underwear, which kills the look and feel of the screen.

    in some ways, I tried to remove the ddl, but it does not work for me.

    Please suggest me how to remove the ddl dynamically, when I try to remove it, it gives IllegalArgumentException meaning is the ddl

    not this Manager field. I'm removing the same administrator only, but I have not found why it's happening...!

    Please help me! Here is my

    It's my custom ddl code.

    public class CustomComboBox extends ObjectChoiceField   {
    
          private int width;        public boolean itemadded = false;
    
    //       CustomComboBox()//        {////         super("Currency",curr, 0, ObjectChoiceField.FIELD_LEFT);//        }     public CustomComboBox(String str,String []curr, int width)        {         super(str, curr, 0, ObjectChoiceField.FIELD_LEFT | ObjectChoiceField.USE_ALL_WIDTH);          this.width = width;           Font font = this.getFont().derive(Font.EMBOSSED_EFFECT | Font.BOLD, 14);          this.setFont(font);
    
         }     public CustomComboBox(String str,String []curr, int startindex, int width)        {         super(str, curr, startindex, ObjectChoiceField.FIELD_LEFT | ObjectChoiceField.USE_ALL_WIDTH);         this.width = width;           Font font = this.getFont().derive(Font.EMBOSSED_EFFECT | Font.BOLD, 14);          this.setFont(font);       }     protected void layout(int width, int height)      {         setExtent(this.width, 40);        }     public void paint(Graphics g)     {           //            g.setBackgroundColor(Color.BLUE);//           g.clear();            g.setColor(Color.BLACK);          super.paint(g);       }     public void setVisiblity(boolean on)      {//           this.setVisualState(VISUAL_STATE_DISABLED);//         this.setVisualState(VISUAL_STATE_DISABLED_FOCUS);
    
          }     protected void fieldChangeNotify(int context)        {          try {              this.getChangeListener().fieldChanged(this, context);                 } catch (Exception exception) {               }        } }
    

    This is the place where to use this object class

    class ItemList extends Manager implements FieldChangeListener{  SubItemList subitems;
    
      String []cycleitems = {"Standard", "Kids", "Racers"}; String []spareitems = {"Tyres", "Tubes", "Covers"};   String []healthitems = {"Medicines","Fruits","Drinks"};   String []fitnessitems = {"Walker", "Dumbles"};    String []empty = {"                    "};
    
      CustomComboBox ddl_cycle, ddl_spares, ddl_fitness, ddl_health, ddl;   MyTextField lbl_subcategory;//    CustomTextBox txt_qty;    ItemList(int index)   {     super(Manager.VERTICAL_SCROLL | Manager.HORIZONTAL_SCROLL);
    
            subitems = new SubItemList(index,0);
    
          ddl_cycle = new CustomComboBox("Cycles", cycleitems,  140);       ddl_spares = new CustomComboBox("Spares", spareitems, 140);       ddl_health = new CustomComboBox("Health", healthitems, 140);      ddl_fitness = new CustomComboBox("Fitness", fitnessitems,140);        ddl = new CustomComboBox("",empty ,100);
    
          lbl_subcategory = new MyTextField("Sub-Category:",Field.FIELD_LEFT, 16);//        lbl_qty = new MyTextField("Qty", Field.FIELD_LEFT, 16);//     txt_qty = new CustomTextBox(30,20);
    
          ddl_cycle.setChangeListener(this);        ddl_spares.setChangeListener(this);       ddl_health.setChangeListener(this);       ddl_fitness.setChangeListener(this);
    
          switch(index)     {         case 0: ddl = ddl_cycle;                  break;            case 1: ddl = ddl_spares;                 break;            case 2: ddl = ddl_health;                 break;            case 3: ddl = ddl_fitness;                    break;        }     add(lbl_subcategory);     add(ddl);     add(subitems);    } public void delItems()    {     subitems.delSubItems();       deleteAll();  } public void setvisibility(boolean on) {     ddl.setVisiblity(false);  } protected void sublayout(int width, int height)   {     if(lbl_subcategory != null)       {         setPositionChild(lbl_subcategory, 0, 25);         layoutChild(lbl_subcategory, getScreen().getWidth(), getScreen().getHeight());        }
    
          setPositionChild(ddl, 110, 15);       layoutChild(ddl, getScreen().getWidth(), getScreen().getHeight());
    
          if(subitems != null)      {         setPositionChild(subitems, 0, 60);            layoutChild(subitems, getScreen().getWidth(), getScreen().getHeight());       }
    
          setExtent(360, 150);  }
    

    This is the place where works the dynamic change of ddl

    class OrderEntryManager extends Manager implements FieldChangeListener{
    
    ItemList items;    ButtonField   btn_submit;     MyButtonField  btn_cycles, btn_spares, btn_health, btn_fitness, btn_go;
    
    OrderEntryManager(){items = new ItemList(0);btn_cycles = new MyButtonField("Cycles", "orderimg/cycle.png", "orderimg/cycle.png",0x00FFE7AD);     btn_spares = new MyButtonField("Spares", "orderimg/spares.png", "orderimg/spares.png",0x00FFE7AD);        btn_fitness = new MyButtonField("Fitness", "orderimg/fi.....);
    
    add(items);
    
    }public void fieldChanged(Field field, int context)    {
    
          if(field instanceof MyButtonField)        {         if (((MyButtonField) field).getLabel().equalsIgnoreCase("Cycles"))            {//               items.delItems();//               this.delete(items);//             items.setVisualState(VISUAL_STATE_DISABLED);              items.setvisibility(false);               items = new ItemList(0);              add(items);            }            else if (((MyButtonField) field).getLabel().equalsIgnoreCase("Spares"))           {//               items.setVisualState(VISUAL_STATE_DISABLED);//                items.setvisibility(false);               items = new ItemList(1);              add(items);//             items = itemsnew;         }         else if (((MyButtonField) field).getLabel().equalsIgnoreCase("Health"))           {//               items.setVisualState(VISUAL_STATE_DISABLED);//                items.setvisibility(false);               items = new ItemList(2);              add(items);//             items = itemsnew;         }         else if(((MyButtonField) field).getLabel().equalsIgnoreCase("Go"))            {
    
              }         else if (((MyButtonField) field).getLabel().equalsIgnoreCase("Fitness"))          {//               items.setVisualState(VISUAL_STATE_DISABLED);//                items.setvisibility(false);               items = new ItemList(3);              add(items);//              items = itemsnew;            }     }     else if (field instanceof ButtonField)         {//           if (((ButtonField) field).getLabel().equalsIgnoreCase("Fitness"))//              {//                   items = new ItemList(3);//                    add(items);// //               items = itemsnew;  //                }           if(((ButtonField) field).getLabel().equalsIgnoreCase("Submit"))             {               synchronized(Application.getEventLock())                    {                     UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());                       UiApplication.getUiApplication().pushScreen(new OrderConfirmScreen());                    }             }      }            if(items != null)         {             updateLayout();           }
    
     }
    
    }
    

    Please suggest me how to remove the ddl for this!

    Hi all, I have solved this problem by using ddl.setChoice (String []);

    Thank you for all that you.

  • using the App: variable scrollbar help and problems

    It is a large amount of code, but please bare with me please.  I would really appreciate the help!

    If I write a financial application where the user enters the initial investment, the compound interest rate period and duration of investment and it calculates the value.  Here is my code: each "screen" that appears on the emulator is its own class:

    package com.rim.samples.Finance;
    
    import net.rim.device.api.ui.UiApplication;
    
    public class FinanceApplication extends UiApplication
    {
        //VARIABLES FOR THE INVESTMENT GROWTH
        public double initialInvestment;
        public double interest;
        public int compoundPeriod;
        public int investmentLength;
    
        public static void main(String[] args)
        {
            FinanceApplication firstApplication  = new FinanceApplication();
            firstApplication.enterEventDispatcher();
        }
    
        public FinanceApplication()
        {
            //OPENING SCREEN FOR INVESTMENT GROWTH
            pushScreen(new Screen1());
        }
    
    }
    
    //SCREEN 1 INPUTS *INITIAL INVESTMENT*
    
    package com.rim.samples.Finance;
    
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.MenuItem;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.Menu;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.Border;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class Screen1 extends MainScreen implements FieldChangeListener
    {
    
        //DECLARE MENU BUTTONS
        protected void makeMenu(Menu menu, int instance)
        {
    
            menu.add(_close);
        }
        private MenuItem _close = new MenuItem("Close", 110, 10)
        {
            public void run()
            {
                onClose();
            }
        };
        public boolean onClose()
        {
            Dialog.alert("Goodbye!");
            System.exit(0);
            return true;
        }
    
        //SCREEN 1 METHOD
        Screen1()
        {
    
            HorizontalFieldManager _fieldManagerTop = new HorizontalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
            VerticalFieldManager _fieldManagerMiddle = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
            HorizontalFieldManager _fieldManagerBottom = new HorizontalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
            HorizontalFieldManager _fieldManagerButton = new HorizontalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
    
            //SET TITLE: FINANCIAL APPLICATION
            LabelField title = new LabelField ("Financial Application", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            Font titleFont = this.getFont().derive(Font.BOLD | Font.ITALIC);
            title.setFont(titleFont);
            setTitle(title);
    
            //SET PAGE & INFO TEXT
            LabelField _page = new LabelField("Homepage ~ Initial Investment", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            LabelField _info = new LabelField("\nThis application acts as a an investment or growth calculator.  The user inputs the amount of money he or she would like to invest originally, input the interest, the compound period, the regular monthly deposit into the investment, and the time her or she will have the investment and this application will calculate how much the investment will be worth.\n\n Please enter initial amount of money you are depositing into the investment.\n$XX.xx", LabelField.USE_ALL_WIDTH);
    
            //INPUT FIELDS TESTING!!!!
    
            //INPUT FIELD W/ BORDER
            BasicEditField _input = new BasicEditField();
    
            XYEdges padding = new XYEdges(10, 10, 10, 10);
            int color = Color.DARKGREEN;
            int lineStyle = Border.STYLE_SOLID;
            Border inputBorder = BorderFactory.createRoundedBorder(padding, color, lineStyle);
            _input.setBorder(inputBorder);
    
            //ADD FIELDS AND SEPARATORS
            add(_fieldManagerTop);
            add(new SeparatorField());
            add(_fieldManagerMiddle);
            add(new SeparatorField());
            add(_fieldManagerBottom);
            add(new SeparatorField());
            add(_fieldManagerButton);
    
            //ADD PAGE, INFO, INPUT
            _fieldManagerTop.add(_page);
            _fieldManagerMiddle.add(_info);
            _fieldManagerBottom.add(_input);
    
            //CREATE BUTTON TO NEXT PAGE
            ButtonField pressButton = new ButtonField("NEXT");
            pressButton.setChangeListener(this);
            _fieldManagerButton.add(pressButton);
    
        }
    
        //BUTTON FIELD CHANGE: ACTIONS
        public void fieldChanged(Field field, int context)
        {
            // PROBLEM IS HERE, I WANT WHATEVER IS TYPED INTO _input TO BE SET AS THE VARIABLE initialInvestmentFinanceApplication.initialInvestment=_input;
    
            UiApplication.getUiApplication().popScreen(this);
            UiApplication.getUiApplication().pushScreen(new Screen2());
    
        }
    
    }
    
    //SCREEN 2 INPUTS *INTEREST*
    
    package com.rim.samples.Finance;
    
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.MenuItem;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.Menu;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.Border;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class Screen2 extends MainScreen implements FieldChangeListener
    {
        //DECLARE MENU BUTTONS
        protected void makeMenu(Menu menu, int instance)
        {
            menu.add(_home);
            menu.add(_close);
        }
    
        private MenuItem _home = new MenuItem("Home Page", 110, 10)
        {
                public void run()
                {
                    onHome();
                }
        };
    
        public boolean onHome()
        {
            Dialog.alert("Homepage Selected");
            UiApplication.getUiApplication().popScreen(this);
            UiApplication.getUiApplication().pushScreen(new Screen1());
            return true;
        }
    
        private MenuItem _close = new MenuItem("Close", 110, 10)
        {
            public void run()
            {
                onClose();
            }
        };
    
        public boolean onClose()
        {
            Dialog.alert("Goodbye!");
            System.exit(0);
            return true;
        }
    
        //SCREEN 2 METHOD
        Screen2()
        {
            HorizontalFieldManager _fieldManagerTop = new HorizontalFieldManager();
            VerticalFieldManager _fieldManagerMiddle = new VerticalFieldManager();
            HorizontalFieldManager _fieldManagerBottom = new HorizontalFieldManager();
            HorizontalFieldManager _fieldManagerButton = new HorizontalFieldManager();
    
            //SET TITLE: FINANCIAL APPLICATION
            LabelField title = new LabelField ("Financial Application", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            Font titleFont = this.getFont().derive(Font.BOLD | Font.ITALIC);
            title.setFont(titleFont);
            setTitle(title);
    
            //SET PAGE & INFO TEXT
            LabelField _page = new LabelField("Page Two ~ Interest", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            LabelField _info = new LabelField("\nNow please enter the interest that will be put on this investment", LabelField.USE_ALL_WIDTH);
    
            //INPUT FIELD W/ BORDER
            BasicEditField _input = new BasicEditField();
            XYEdges padding = new XYEdges(10, 10, 10, 10);
            int color = Color.DARKGREEN;
            int lineStyle = Border.STYLE_SOLID;
            Border inputBorder = BorderFactory.createRoundedBorder(padding, color, lineStyle);
            _input.setBorder(inputBorder);
    
            //ADD FIELDS AND SEPARATORS
            add(_fieldManagerTop);
            add(new SeparatorField());
            add(_fieldManagerMiddle);
            add(new SeparatorField());
            add(_fieldManagerBottom);
            add(new SeparatorField());
            add(_fieldManagerButton);
    
            //ADD PAGE, INFO, INPUT
            _fieldManagerTop.add(_page);
            _fieldManagerMiddle.add(_info);
            _fieldManagerBottom.add(_input);
    
            //CREATE BUTTON TO NEXT PAGE
            ButtonField pressButton = new ButtonField("NEXT");
            pressButton.setChangeListener(this);
            _fieldManagerButton.add(pressButton);
    
        }
    
        //BUTTON FIELD CHANGE: ACTIONS
        public void fieldChanged(Field field, int context)
        {
            UiApplication.getUiApplication().popScreen(this);
            UiApplication.getUiApplication().pushScreen(new Screen3());
        }
    }
    
    //SCREEN 3 INPUTS *COMPOUND PERIOD*
    
    package com.rim.samples.Finance;
    
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.MenuItem;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.Menu;
    import net.rim.device.api.ui.component.ObjectChoiceField;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.Border;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class Screen3 extends MainScreen implements FieldChangeListener
    {
        //DECLARE MENU BUTTONS
        protected void makeMenu(Menu menu, int instance)
        {
            menu.add(_home);
            menu.add(_close);
        }
    
        private MenuItem _home = new MenuItem("Home Page", 110, 10)
        {
                public void run()
                {
                    onHome();
                }
        };
    
        public boolean onHome()
        {
            Dialog.alert("Homepage Selected");
            UiApplication.getUiApplication().popScreen(this);
            UiApplication.getUiApplication().pushScreen(new Screen1());
            return true;
        }
    
        private MenuItem _close = new MenuItem("Close", 110, 10)
        {
            public void run()
            {
                onClose();
            }
        };
    
        public boolean onClose()
        {
            Dialog.alert("Goodbye!");
            System.exit(0);
            return true;
        }
    
        //SCREEN 3 METHOD
        Screen3()
        {
    
            HorizontalFieldManager _fieldManagerTop = new HorizontalFieldManager();
            VerticalFieldManager _fieldManagerMiddle = new VerticalFieldManager();
            HorizontalFieldManager _fieldManagerBottom = new HorizontalFieldManager();
            HorizontalFieldManager _fieldManagerButton = new HorizontalFieldManager();
    
            //SET TITLE: FINANCIAL APPLICATION
            LabelField title = new LabelField ("Financial Application", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            Font titleFont = this.getFont().derive(Font.BOLD | Font.ITALIC);
            title.setFont(titleFont);
            setTitle(title);
    
            //SET PAGE & INFO TEXT
            LabelField _page = new LabelField("Page Three ~ Compound Period", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);;
            LabelField _info = new LabelField("\nNow please enter the compound period.\npress spacebar to go through the choices:", LabelField.USE_ALL_WIDTH);;
    
            //ADD FIELDS AND SEPARATORS
            add(_fieldManagerTop);
            add(new SeparatorField());
            add(_fieldManagerMiddle);
            add(new SeparatorField());
            add(_fieldManagerBottom);
            add(new SeparatorField());
            add(_fieldManagerButton);
    
            //OBJECT CHOICE FIELD
            String choicestrs[] = {"Weekly", "Bi-Weekly", "Monthly", "Quarterly", "Annually"};
            ObjectChoiceField choice = new ObjectChoiceField("Compound Period: ", choicestrs, 0);
    
            //ADD PAGE, INFO, OBJECT CHOIE TO FIELD
            _fieldManagerTop.add(_page);
            _fieldManagerMiddle.add(_info);
            _fieldManagerBottom.add(choice);
    
            //CREATE BUTTON TO NEXT PAGE
            ButtonField press2Button = new ButtonField("NEXT");
            press2Button.setChangeListener(this);
            _fieldManagerButton.add(press2Button);
    
        }
    
        //BUTTON FIELD CHANGE: ACTIONS
        public void fieldChanged(Field field, int context)
        {
            UiApplication.getUiApplication().popScreen(this);
            UiApplication.getUiApplication().pushScreen(new Screen4());
        }
    }
    
    //SCREEN 4 INPUTS *LENGTH OF INVESTMENT*
    
    package com.rim.samples.Finance;
    
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.MenuItem;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.Menu;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.Border;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class Screen4 extends MainScreen implements FieldChangeListener
    {
        //DECLARE MENU BUTTONS
        protected void makeMenu(Menu menu, int instance)
        {
            menu.add(_home);
            menu.add(_close);
        }
    
        private MenuItem _home = new MenuItem("Home Page", 110, 10)
        {
                public void run()
                {
                    onHome();
                }
        };
    
        public boolean onHome()
        {
            Dialog.alert("Homepage Selected");
            UiApplication.getUiApplication().popScreen(this);
            UiApplication.getUiApplication().pushScreen(new Screen1());
            return true;
        }
    
        private MenuItem _close = new MenuItem("Close", 110, 10)
        {
            public void run()
            {
                onClose();
            }
        };
    
        public boolean onClose()
        {
            Dialog.alert("Goodbye!");
            System.exit(0);
            return true;
        }
    
        //SCREEN 4 METHOD
        Screen4()
        {
            HorizontalFieldManager _fieldManagerTop = new HorizontalFieldManager();
            VerticalFieldManager _fieldManagerMiddle = new VerticalFieldManager();
            HorizontalFieldManager _fieldManagerBottom = new HorizontalFieldManager();
            HorizontalFieldManager _fieldManagerButton = new HorizontalFieldManager();
    
            //SET TITLE: FINANCIAL APPLICATION
            LabelField title = new LabelField ("Financial Application", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            Font titleFont = this.getFont().derive(Font.BOLD | Font.ITALIC);
            title.setFont(titleFont);
            setTitle(title);
    
            //SET PAGE & INFO TEXT
            LabelField _page = new LabelField("Page Four ~ Investment Length", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            LabelField _info = new LabelField("\nNow please enter how long you will have this investment for?\nPlease enter the amount in months:", LabelField.USE_ALL_WIDTH);
    
            //INPUT FIELD W/ BORDER
            BasicEditField _input = new BasicEditField();
            XYEdges padding = new XYEdges(10, 10, 10, 10);
            int color = Color.DARKGREEN;
            int lineStyle = Border.STYLE_SOLID;
            Border inputBorder = BorderFactory.createRoundedBorder(padding, color, lineStyle);
            _input.setBorder(inputBorder);
    
            //ADD FIELDS AND SEPARATORS
            add(_fieldManagerTop);
            add(new SeparatorField());
            add(_fieldManagerMiddle);
            add(new SeparatorField());
            add(_fieldManagerBottom);
            add(new SeparatorField());
            add(_fieldManagerButton);
    
            //ADD PAGE, INFO, INPUT
            _fieldManagerTop.add(_page);
            _fieldManagerMiddle.add(_info);
            _fieldManagerBottom.add(_input);
    
            //CREATE BUTTON TO NEXT PAGE
            ButtonField pressButton = new ButtonField("NEXT");
            pressButton.setChangeListener(this);
            _fieldManagerButton.add(pressButton);
    
        }
    
        //BUTTON FIELD CHANGE: ACTIONS
        public void fieldChanged(Field field, int context)
        {
            UiApplication.getUiApplication().popScreen(this);
            UiApplication.getUiApplication().pushScreen(new InvestmentWorth());
        }
    }
    
    //INVESTMENT WORTH
    
    package com.rim.samples.Finance;
    
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.MenuItem;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.Menu;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.Border;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class InvestmentWorth extends MainScreen
    {
    
        //DECLARE MENU BUTTONS
        protected void makeMenu(Menu menu, int instance)
        {
    
            menu.add(_close);
        }
        private MenuItem _close = new MenuItem("Close", 110, 10)
        {
            public void run()
            {
                onClose();
            }
        };
        public boolean onClose()
        {
            Dialog.alert("Goodbye!");
            System.exit(0);
            return true;
        }
    
        //SCREEN 1 METHOD
        InvestmentWorth()
        {
    
            HorizontalFieldManager _fieldManagerTop = new HorizontalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
            VerticalFieldManager _fieldManagerMiddle = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
            HorizontalFieldManager _fieldManagerBottom = new HorizontalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
    
            //SET TITLE: FINANCIAL APPLICATION
            LabelField title = new LabelField ("Financial Application", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            Font titleFont = this.getFont().derive(Font.BOLD | Font.ITALIC);
            title.setFont(titleFont);
            setTitle(title);
    
            //SET PAGE & INFO TEXT
            LabelField _page = new LabelField("Homepage ~ Initial Investment", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
            LabelField _info = new LabelField("\nHere is the worth of your investment:\n", LabelField.USE_ALL_WIDTH);
    
            //INPUT FIELD W/ BORDER
            LabelField _worth = new LabelField();
            XYEdges padding = new XYEdges(10, 10, 10, 10);
            int color = Color.BLACK;
            int lineStyle = Border.STYLE_SOLID;
            Border inputBorder = BorderFactory.createRoundedBorder(padding, color, lineStyle);
            _worth.setBorder(inputBorder);
    
            //ADD FIELDS AND SEPARATORS
            add(_fieldManagerTop);
            add(new SeparatorField());
            add(_fieldManagerMiddle);
            add(new SeparatorField());
            add(_fieldManagerBottom);
    
            //ADD PAGE, INFO, INPUT
            _fieldManagerTop.add(_page);
            _fieldManagerMiddle.add(_info);
            _fieldManagerBottom.add(_worth);
    
        }
    
    }
    

    So when I run on the emulator, on Blackbery 8520 SDK emulator, it doesn't let me scroll upwards on the first screen to see the rest of the text, it's like the cursor on the button sticks or editing field base so it wont allow to exceed upwards the button or basic edit field , but I can scroll between them.

    Second problem is trying to address (as defined in the first class) variables to different edit fields so when something is typed in (double), it is placed in the variable to use in the rest of the program.  I want to make sure the basic edit fields only allow "double" number entered, otherwise it displays a message 'incorrect type '.   Please help me with this, or give me some advice.

    I would REALLY appreciate it.

    LabelFields will display several lines later the OS, so maybe this isn't a problem.  However, LabelFields are by default not active, so you can't scroll on them.  RichTextFields are active by default.  So either change your LabelFields for et focusable (style LabelField.FOCUSABLE) pr change to RichTextField, as the previous poster suggested.

    I do not understand your second question, what are the numbers 'double '?

    However, I was watching the styles FILTER_ that you can use to BasicEditField or watch extending TextFilter to check the characters that they are entered.  I suspect TextFilter is the right way to go, but I've never done anything like this.  But having a good overview in this field and classes that extends.

Maybe you are looking for

  • 2013 iMac hangs in mode 'sleep'

    When I put my computer to sleep at night, most of the time when I wake up in the morning, it reports a report creash, this happens several times a week even when executing hardware checks that it does not find any problem.

  • PB all DLLs with in VS 2003 DAQmx labview

    Hello everyone. I've created a dll using the DAQmx tasks in Labview. I call it in Visual Studio C++ 2003. There are two heads, this one and the one of NIDAQmx.h. In the race, I have Visual C++ Runtime error. Can someone explain to me what is happenin

  • Xperia Tablet has a bug between wifi and bluetooth

    bluetooth A2DP headset cuts in and out when you cut the wifi. It is a huge problem.

  • BlackBerry smartphone how to protect my device? viruses?

    HelloY at - it app for protect my BB from viruses? Or is it already in my device? I want to know how to please

  • TMS shows VC as ANY HTTP RESPONSE endpoints

    Hi all TMS poster telepresence endpoints units under NO RESPONSE HTTP status After the upgrade successfully 100 end points TP to 7.3.6 with TMS version 14.5 firmware. a few end points reflecting the situation as no respose http under TMS - section en