HorizontalFieldManager question

I have the following text for the day of the week display boxes

public HorizontalFieldManager ffm_days = new HorizontalFieldManager (Field.FIELD_LEFT);

ffm_days. Add (Days [i])

This.Add (ffm_days)

This works very well on all operating systems, but NOT on the OS6.

the screen would display the following boxes horizontally

S M T W T F S

but the torch, it shows that S box and reset are somewhere on the right side which I can't scroll or see.

What is the best way to get boxes grouped and displayed horizontally? THX

On the 6.0 check boxes using any of the default width.

You must override the method of layout of boxes and set its measurement getPreferredWidth() box so that the same behavior than 5.0 and below.

This hotfix does not break the previous OS impl. or the other.

Tags: BlackBerry Developers

Similar Questions

  • Question of width for HorizontalFieldManager nin BB OS 6.0 and 7.0

    Hi all

    I developed a new application for BB OS 5.0, 6.0 and 7.0, which in its homepage has a bar containing different categories of navigation. The navigation bar is designed as:

    public HeaderMenu (String [] categories, HeaderMenuListener listCallback) {}
    Super(NO_HORIZONTAL_SCROLL |) NO_HORIZONTAL_SCROLLBAR | FOCUSABLE);
            
    mCategories = categories;
    mNewsListCallback = listCallback;
    mButtons = new CustomButton [mCategories.length];
    noOfCategories = mCategories.length;
    ND = this;
            
    mCategoryNavigator = new HorizontalFieldManager(FOCUSABLE |) HORIZONTAL_SCROLL |       HORIZONTAL_SCROLLBAR) {}

    public int getPreferredWidth() {}
    If (noOfCategories > 1) {}
    navigatorWidth = Display.getWidth () - mLeftNavigator.getWidth () - mRightNavigator.getWidth ();
    return Display.getWidth () - mLeftNavigator.getWidth () - mRightNavigator.getWidth ();
    }
    else {}
    Return Display.getWidth ();
    }
    };
                
    protected void sublayout (int maxWidth, maxHeight int) {}
    Super.sublayout (maxWidth, maxHeight);
    setExtent (getPreferredWidth (), getPreferredHeight());
    };
                
    };
    loadCategoryView();

    mLeftNavigator = new BitmapField (AppResolutionVariables.mLeftNavigationBtn, NON_FOCUSABLE);
    mRightNavigator = new BitmapField (AppResolutionVariables.mRightNavigationBtn, NON_FOCUSABLE);

    If (noOfCategories > 1)
    {
    Add (mLeftNavigator);
    }
    Add (mCategoryNavigator);
    If (noOfCategories > 1)
    {
    Add (mRightNavigator);
    }
    this.setBackground (BackgroundFactory.createSolidBackground (COLOR_MAROON));
    }
        
    /**
    The method of loading of new categories in a scroll handler.
    */
    private void loadCategoryView() {}
            
    int size = mCategories.length;
            
    Added table of buttons representative of the new categories to the Manager of scrolling.
    for (int i = 0; i)<>
    String categoryName = mCategories [i];
    mButtons [i] = new CustomButton (categoryName, DATA_FONT_BOLD, DATA_FONT_PLAIN,
    COLOR_MAROON, COLOR_WHITE) {}
                    
    public int getPreferredHeight() {}
    Return AppResolutionVariables.mLeftNavigationBtn.getHeight ();
    };
                    
    protected boolean navigationClick (int status, int time) {}
    int index = Arrays.getIndex (mButtons, this);
    If (index > = 0) {}
    mNewsListCallback.notifyHeaderButtonClick (index);
    }
    Returns true;
    }
    };
    mCategoryNavigator.add (mButtons [i]);
    }
    }

    Method takes care of asking left and right navigation buttons and scrollable Manager in the correct position.
    protected void sublayout (int maxWidth, maxHeight int) {}
            
    Super.sublayout (maxWidth, maxHeight);
    setExtent (getPreferredWidth (), getPreferredHeight());
            
    If (noOfCategories > 1) {}
    layoutChild (mLeftNavigator, maxWidth, maxHeight);
    setPositionChild (mLeftNavigator, 0, 0);
    }
            
    layoutChild (mCategoryNavigator, maxWidth, maxHeight);
    If (noOfCategories > 1) {}
    setPositionChild (mCategoryNavigator, mLeftNavigator.getWidth (), 0);
    } else {}
    setPositionChild (mCategoryNavigator, 15, 0);
    }
            
    If (noOfCategories > 1) {}
    layoutChild (mRightNavigator, maxWidth, maxHeight);
    setPositionChild (mRightNavigator, getPreferredWidth() - mRightNavigator.getWidth (), 0);
    }
    }

    The question do face is, when I scroll horizontally to the last button at the side bar, the last button is not visible completely, it becomes hidden by the right navigation button on the far right of HFM. This issue is in OS 6.0 and 7.0, but not in OS 5.0.

    Earlier, I had the problem in OS 5.0 so to fix it, I prevail on HFM getPreferredWidth() scrolling above, to return the width (width width HFM - width of navigation left button - not with the right navigation button scrolling) and it works fine. Can someone please fix the problem. Thanks in advance.

    Sorry just looking quickly here.

    The question which I believe is in your sublayout.  You tell your mCategoryNavigator field is the maximum width.  This isn't.  There only the width rest once the buttons have been added.

    There are two ways you can solve the problem.

    The simple way is just to spend the maximum width in the super.sublayout for mCategoryNavigator and no maxWidth.

    But the best way is to remove this sublayout completely and in your sublayout for the Manager.  In this handler, the layout and position your two buttons, then give the drop-down field which remains as its maximum width.

    Two other comments:

    (a) I would like to forget calling super.layout in your HeaderMenu and make everything in your own sublayout.  It would be a good exercise.  Remember the last thing you do is a setExtent, once you have placed all and so that you know how much space you need.

    (b) If you never call super.layout and then do a setExtent to get the correct size, the alarm should sound.  It's a bit like someone who gives a piece of paper, asking them to draw a picture and then decide that in fact the piece of paper is a different size of paper, that they needed to make the drawing.  You are actually asking someone else to do something and then ignoring what they have done (or at least a part of it).  If you find that you need to do, then look for another way as setExtent substitution causes the sorts of problems you found.

  • Question of the development of EditField and LabelField in HorizontalFieldManager

    I actually want a custom editfield (a label with a textbox), when he got focus on this textbox draws a border of climax, and I want the label got the same effect, however, I drew a border outside the text easily because of the text box could receive focus , here is my code:

    public class MyTextField extends EditField
    {
        public MyTextField()
        {
            super();
        }
    
        public void layout(int width, int height)
        {
            super.layout(width, height);
        }
    
        protected void paint(Graphics g)
        {
            if(g.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS))
            {
                setBorder(BorderFactory.createRoundedBorder(new XYEdges(6, 6, 6, 6), 0x186DEF, Border.STYLE_SOLID));
            }else{
                setBorder(BorderFactory.createRoundedBorder(new XYEdges(6, 6, 6, 6), Color.GRAY, Border.STYLE_SOLID));
            }
    
            super.paint(g);
         }
    }
    

    And I use this code to show in screen

           HorizontalFieldManager hfm=new HorizontalFieldManager();
            LabelField label=new LabelField("something");
            MyTextField text=new MyTextField();
    
            hfm.add(label);
            hfm.add(text);
            add(hfm);
    

    Is there a way to implement that when the textbox has got the update at the same time also changed the color of the text of the label.

    set a Boolean flag that you record in paint, set it on the ground (from outside) and invalid call to redraw.

  • Fixed HorizontalFieldManager Albums

    Hello

    I'm doing a top fixed banner (HorizontalFieldManager), style facebook/twitter, but I have no idea how do:

    I have tired:

    fmt=new HorizontalFieldManager(Manager.USE_ALL_WIDTH | Manager.NO_VERTICAL_SCROLL );
    

    But it did not work, the Manager moves upward when I scroll down.

    Hope you guys can help me.

    In addition, how can I Center all the buttons inside the HorizontalFieldManager?

    Welcome to the forum.

    What you ask is not trivial and will require a bit of reading as well as essays and substantive errors.

    Start by reading from this base.

    http://supportforums.BlackBerry.com/T5/Java-development/MainScreen-explained/Ta-p/606644

    http://supportforums.BlackBerry.com/T5/Java-development/create-a-custom-layout-manager-for-a-screen/...

    http://supportforums.BlackBerry.com/T5/Java-development/how-to-extend-Manager/Ta-p/446749

    Once you have been through this, so try a few options and ask questions.

    I'm not aware of a KB article or thread on this forum that corresponds exactly to your needs, but there are lots of similar questions, so search the Forum to find answers too.

    Good luck.

  • BasicEditFields will not be displayed in HorizontalFieldManager

    I have 3 BasicEditFields next to each other, but when I place it in a HorizontalFIeldManager, one appears where it should be on the left, but the other two do not.

    Any ideas on how I can fix this? Thank you.

    Scott

    QCB is correct, that basiceditfields do not play fair, because they will be the default use full width, which doesn't leave much space for the remaining fields.

    You have two choices:

    (a) BasicEditField override to limit the used width - you can do this by substituting the layout and getPreferredWidth.  There are a lot of similar questions on the forum, I'm sure if you search you can find another person who posted code that does.

    (b) change you Layout Manager so that it restricts the width that it helps the BasicEditField.  The TableLayoutManager sample provided by RIM (see the knowledge base) shows an example of this.

    Which of these two approaches you choose will depend on the conditions of Application.

    Note that you must take into account what happens on a storm in Portrait modes and landscape.

  • Question about FieldChangeListener

    Finally, I'm going back to rewrite the custom PopupScreen that I created for a blackberry app staff.

    I had a question on a FieldChangeListener I set myself for a button.

    The code looks like this:

    FieldChangeListener fcl = new FieldChangeListener()
    {
      public void fieldChanged(Field field, int context)
      {
        fieldChangeNotify(cancel) //cancel is a public static final int
        close();
      }
    };
    
    ButtonField.setChangeListener(fcl);
    

    My question is this: how to retrieve the context of int fieldChangeNotify (int context) value if the listener is attached to the key?

    I am tempted to write a method that mimics the method getSelectedValue() of the dialog class.

    I just wrote to follow him, not production code, but I need something similar to what you want (a dialog box I could put things in).  I hope you can use it, and it shows you how to enable a button in a return code.

    Note that the questionField is optional, basically, the idea is that this screen will be used when it is necessary to confirm an action and collect additional information.  You can ignore it.

    Here is an example of using the screen - I have; ve just done upwards, so please forgive the errors:

    BasicEditField _questionField = new BasicEditField ("reason for Deferring:", "");
    Create the popup to confirm the defer
    ConfirmActionPopupScreen caps = new ConfirmActionPopupScreen ("Confirm Report", _questionField);
    int response = caps.doModal ();
    If (int ==-1) {}
    cancelled
    } else {}
    Oudit
    String pattern = _questionField.getText ();
    ...
    }

    And here is the screen.  Note that I had to change a few things that are specific to what I do, so it would not work, but you get the idea.

    I hope it works for you.

    class ConfirmActionPopupScreen extends PopupScreen
                                   implements FieldChangeListener {
    
        private ButtonField _okButton = new ButtonField("OK");
        private ButtonField _cancelButton = new ButtonField("Cancel");
        private BasicEditField _questionField = null;
    
        private int _returnCode = -1; // Default to Cancel value
    
        //statics ------------------------------------------------------------------
        private static ResourceBundle _resources = ResourceBundle.getBundle(UIResource.BUNDLE_ID, UIResource.BUNDLE_NAME);
    
        public ConfirmActionPopupScreen(String confirmString, BasicEditField questionField) {
            super(new VerticalFieldManager(),Field.FOCUSABLE);
            // Question Icon and text on top
            HorizontalFieldManager hfm = new HorizontalFieldManager();
            hfm.add(new BitmapField(Bitmap.getPredefinedBitmap(Bitmap.QUESTION), BitmapField.FIELD_LEFT));
            hfm.add(new LabelField(" ")); // Just to space it a bit
            hfm.add(new RichTextField(confirmString, RichTextField.FIELD_HCENTER | RichTextField.FIELD_VCENTER ));
            this.add(hfm);
            this.add(new SeparatorField());
            // Optional Question
            _questionField = questionField;
            if ( _questionField != null ) {
                this.add(_questionField);
                this.add(new SeparatorField());
            }
            // Buttons at bottom
            hfm = new HorizontalFieldManager(Field.FIELD_HCENTER);
            hfm.add(_okButton);
            _okButton.setChangeListener(this);
            hfm.add(_cancelButton);
            _cancelButton.setChangeListener(this);
            add(hfm);
    
            // Focus on Question or Cancel Button
            if ( _questionField != null ) {
                _questionField.setFocus();
            } else {
                _cancelButton.setFocus();
            }
        }
    
        /**
         * Diaplay this Screen and wait for response
         * @return indicator of selected button
         */
        public int doModal() {
            UiApplication.getUiApplication().pushModalScreen(this);
            return _returnCode;
        }
    
        /**
         * Only used to process ESC as Cancel
         */
        public boolean keyChar(char key, int status, int time) {
            //intercept the ESC key - exit the app on its receipt
            boolean retval = false;
            switch (key) {
                case Characters.ESCAPE:
                    _returnCode = -1;
                    close();
                    return true;
            }
            return super.keyChar(key,status,time);
        }
    
        public void close() {
            UiApplication.getUiApplication().popScreen(this);
        }
    
        /**
         * Listen for Button press, and process accordingly.>
         */
        public void fieldChanged(Field field, int context) {
            if ( context == FieldChangeListener.PROGRAMMATIC ) {
                return;
            }
            if ( field == _cancelButton ) {
                _returnCode = -1;
                close();
            } else
            if ( field == _okButton ) {
                if ( _questionField != null ) {
                    // Make sure there is some data entered
                    String temp = _questionField.getText();
                    if ( temp == null || temp.length() < 1 ) {
                        Status.show("Input required, please update \"" + _questionField.getLabel() + "\"");
                        _questionField.setFocus();
                        return;
                    }
                }
                _returnCode = 0;
                close();
            }
        }
    
    }
    
  • Question regarding setExtent and getPreferredWidth for the custom field

    I am trying to understand the difference between getPreferredWidth and setExtent, which relate to the width of a custom field.

    I create a field that may be greater than the width of the screen. The field is made up of cells (for example columns and lines or cells, such as a table). The cells contain text, shapes, lines, color, etc. When I display the field I only paint the visible columns on the screen and allow the user to use the trackball to accomplish the columns out of the screen.

    At present, getPreferredWidth returns the total width of the field without all the empty columns, is longer than the width of the screen. I use the same value in setExtent for width. GetPreferredWidth must return the size of the field that is painted on the screen - the total width less the width of the columns out of the screen? I have the same question about setExtent - width either in total, longer than the screen width or the width of the part of the field that is painted on the screen?

    If I use the width of what is painted on the screen or the other of these methods, then the width changes when the user scrolls through the field. As the user scrolls, I calculate the number of columns will agree to a width of the screen and paint these columns. Is it a problem to have the PreferredWidth and the setExtent change width? I read that setExtent is called only when the Manager sets this field, so that the changes will not be recognized.

    It seems to work in two ways in a few simple tests, but I was just curious as the value of width that is right.

    Thank you!

    Mark

    When a field has changed in a way that requires the update of the screen (for example, after scrolling offset changes), simply call invalidate() from this area. That will eventually lead to paint (Graphics) for the field. At this point, you return the update field. (If only part of a field - as a single cell - needs to be updated, there invalidate() versions that accept arguments where, for efficiency, you can limit the update for just this part.)

    If I understand your needs, you can achieve the effect desired in the paint method. You can use the current dimensions of the field, the cutting of the graphics area, and your internal roll compensates to decide what to paint and what to delete. Let your custom field leave white space where you decide of doesn't make is not part of a cell. There is no need to change the scope of the field.

    If you go about it by changing the dimensions of the field, and then you ask the system to play much more work he has to do. If the custom field is the only field on the screen, it won't make much difference in the behavior (although there may be performance). With more than one field, it can be weird effects. For example, suppose that your custom field is one of several fields in a HorizontalFieldManager and you change the field width. When the HorizontalFieldManager recalculates its own layout, it will change the horizontal position of the fields to the right. The effect on the user, I think, would be really confusing: as the custom field parade, parties to the right of the screen could bounce left and right as the changed width field. I can't imagine that's what you want.

    Here's another way to think about this: absent some bit of style, your custom field would prefer be exactly wide and high enough to show all without scrolling. So the width and height would be based on adding the appropriate cell widths and heights, regardless of what actually is on the display. (It's also a long time that you do not have something fanciful.) If the optimum height is a function of the width available - as with sheathed on the line of text - you would implement this logic in the layout method. You then have no use for autonomous preferred width and height).

  • Selection question tab

    I created three buttonfields like this.

    final CreateCustomField field1 = new CreateCustomField ("First tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK);
    "final CreateCustomField field2 = new CreateCustomField second tab", ButtonField.FOCUSABLE | ButtonField.CONSUME_CLICK);
    "final CreateCustomField field3 = new CreateCustomField third tab", ButtonField.FOCUSABLE | ButtonField.CONSUME_CLICK);

    I add this in to the HorizontalFieldManager like that.

    HFM HorizontalFieldManager = new HorizontalFieldManager(Manager.USE_ALL_WIDTH|NO_HORIZONTAL_SCROLL);
    HFM. Add (field1);
    HFM. Add (Field2);
    HFM. Add (field3);

    It is added to the main screen like that.

    Display display = new MainScreen();

    mainScreen.add (hfm);

    Now, three tabs (buttons) horizontal at the top of the main screen.

    Now, I'm clicking on a tab, and the corresponding content must be loaded under the tabs.

    I do like it.

    HFM HorizontalFieldManager = new HorizontalFieldManager (Manager.USE_ALL_WIDTH |) Manager.NO_HORIZONTAL_SCROLL);
    HFM. Add (new CreateCustomField ("First tab", ButtonField.FOCUSABLE |)) ButtonField.CONSUME_CLICK));
    HFM. Add ("new CreateCustomField of tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK));
    HFM. Add ("new CreateCustomField third tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK));

    mainScreen.add (hfm);   Top tabs added to the screen
    VFM VerticalFieldManager = new VerticalFieldManager();
    VFM. Add (new LabelField ("is to test the rendering of dynamic content"));   This is to add the content when you click on the tab.                mainScreen.add (vfm);  Content added to screen

    pushScreen (mainScreen);

    The questions is when clicking on the tab, the content is load and the selected tab is not selected.

    Hope the above information helps.

    Thanks in advance

    Bala.

    Certainly not need a FocusListener I think... But the setFocus() should be submitted... Let me give you an example... When an action takes place, you can focus on a hfm... Therefore, the button will implement a setChangeListener, and in your fieldChanged(), shoud encode you the setFocus...

    Hope this makes sense...

    See you soon...

  • With the help of HorizontalFieldManager inside the VerticalFieldManager

    Hello, I'm looking to Center a button on the middle of the screen. From what I've seen, I should be able to do this by adding the HorizontalFieldManager in the VerticalFieldManager:

    HorizontalFieldManager mensButton =

    new HorizontalFieldManager (Field.FIELD_HCENTER);

     

    VerticalFieldManager = mensButton2

    new VerticalFieldManager (Field.FIELD_VCENTER) ;

    Mens

    = new ButtonField ("Mens Sports");

    mensButton2.add (mensButton);

    mensButton2.add (mens);

    For some reason, this Center only the button horizontally and not vertically. I tried inculdign I tried USE_ALL_HEIGHT, but still does not work. Any ideas?

    Thank you!

    Few things:

    (1) you must indeed your HFM to have USE_ALL_HEIGHT.

    (2) as your screen very probably has a VerticalFeildManager as a delegate (or a Senior Manager, in the case of screen), add mensButton2 to mensButton and mensButton to the screen, not the other way around.

    (3) If you use screen, make sure it has bit style NO_VERTICAL_SCROLL!

    Anyway, this question has been asked many times is not even funny. Unfortunately, it is not easy to use "search" feature for this - 'Centre screen' or 'average' or other stuff brings much too many items, of which most is not relevant.

    I recently gave details on this subject, although that - look at this post:

    How to Center horizontally and vertically...

    Good luck!

  • Background color of the HorizontalFieldManager

    Hi Forum,

    I am struck in one of the problem, I want to set the background for HorizontalFieldManager and VerticalFieldManager.

    Here is my code.

    HorizontalFieldManager Manager = new HorizontalFieldManager (FIELD_TOP);

    Bitmap homeover = Bitmap.getBitmapResource ("home_hover.png");
    Bitmap homenormal = Bitmap.getBitmapResource ("home_normal.png");

    homeBtn = new CustomButton (homeover, homenormal, Field.NON_FOCUSABLE);
    homeBtn.setChangeListener (this);
    Manager.Add (homeBtn);

    Bitmap settingsover = Bitmap.getBitmapResource ("settings_hover.png");
    Bitmap settingnormal = Bitmap.getBitmapResource ("settings_normal.png");
    settingsBtn = new CustomButton (settingsover, settingnormal,
    Field.NON_FOCUSABLE);
    settingsBtn.setChangeListener (this);

    Manager.Add (settingsBtn);

    Manager1 VerticalFieldManager = new VerticalFieldManager)
    FIELD_TOP | USE_ALL_WIDTH | FIELD_RIGHT);
    Bitmap logoutsover = Bitmap.getBitmapResource ("logout_hover.png");
    Bitmap logoutnormal = Bitmap.getBitmapResource ("logout_normal.png");
    logoutBtn = new CustomButton (logoutsover, logoutnormal,
    Field.FIELD_RIGHT | Field.NON_FOCUSABLE);
    logoutBtn.setChangeListener (this);

    Manager1.setbackground (BackgroundFactory
    .createSolidBackground (0x00cccccc));

    Manager1.Add (logoutBtn);

    Manager.Add (Manager1);
    Add (rightFieldManager);
    Manager.Add (new SeparatorField());
    Add (Manager);

    /***/

    The output is that it puts the bottom from Vertical Logout button located right up to my end of the settings button. It is not set the background to the 'home' button.

    Please help me fixing this questions.

    Thanks to the ton.

    Mukesh

    I did it, I just removed the bottom of vertical and horiziontal value Manager and here it works...

  • Interesting question of scrolling

    Hi everyone, I have a problem with scrolling in my area

    The page layout, I currently have is:

           vfm0 = new VerticalFieldManager(USE_ALL_WIDTH | USE_ALL_HEIGHT | NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR);
            add(vfm0);
    
            vfm1 = new VerticalFieldManager(USE_ALL_WIDTH | VERTICAL_SCROLL | VERTICAL_SCROLLBAR);
            vfm0.add(vfm1);
    

    and I add a created custom field to vfm1.

    However, every time I scroll the focus passes power to another, but the screen does not scroll down UNTIL the last field wins the update. Once the last field acquired focus, scrolling further causes the screen to scroll down.

    I tried to add simple labelfields at the vfm1 and it scrolls perfectly but created custom fields are causing the problem.

    Can anyone think of what may cause this effect?

    In the custom field is created, I replace the onFocus() and the onUnfocus() but I do not see why this would have caused this problem.

    I found the problematic code.

    So the custom field I have added is horizontalFieldManager and inside, I bitmapfield

    Now, in the horizontalFieldManager I crushed focus... that makes no sense since fieldmanagers don't really get the focus (as in the past, I read in this forum).

    At the same time, I was the substitution of development for the bitmapfield as well.

    Question/bizarre and illogical behavior...

  • HorizontalFieldManager in a DialogFieldManager

    Hi I'm trying to place a HorizontalFieldManager that contains a BasicEditField and a ButtonField in a DialogFieldManager.  When I run the code below in the HorizontalFieldManager fields do not appear.

    DialogFieldManager dfm = (DialogFieldManager)getDelegate();
             dfm.setIcon(new BitmapField(Bitmap.getPredefinedBitmap(Bitmap.QUESTION)));
             dfm.setMessage(new RichTextField("Select a text file for results"));
    
            _txtfilename = new BasicEditField() {
                protected void paint(Graphics g) {
                    if (getTextLength() == 0) {
                        g.setColor(0x00a0a0a0);
                        g.drawText("Enter Text File Name", 0, 0);
                    }
                    g.setColor(0xF5F5F5);
                    super.paint(g);
                }
            };
            _txtfilename.setBorder(BorderFactory.createSimpleBorder(new XYEdges(2, 2, 2, 2), 0xF5F5F5));
            _btnOK = new ButtonField();
             HorizontalFieldManager hfm = new HorizontalFieldManager()
             {
                 public void sublayout(int width, int height) {
                      int xpos = 0;
                      int ypos = 0;
                      Field field = getField(0);
    
                      setPositionChild(field, xpos, ypos);
                      layoutChild(field, 280, 50);
    
                      Field field1 = getField(1);
    
                      setPositionChild(field1, xpos+20, ypos+80);
                      layoutChild(field1, 100, 50);
    
                      setPosition(150, 220);
                      setExtent(width, height);
                 }
             };
             hfm.add(_txtfilename);
             hfm.add(_btnOK);
             dfm.add(hfm);
    
            _olf = new ObjectListField();
            dfm.addCustomField(_olf);
            updateList(path);
            _txtfilename.setFocus();
    

    Any help would be greatly appreciated.

    Thank you.

    According to my interpretation of the Javadocs, instead:

    DFM. Add (HFM);

    you will need

    dfm.addCustomField (hfm);

    have you tried that?
    :

  • User interface simple Question

    I apologize in advance for the simplicity of this question is probably, but I can't seem to find a way to do it.

    I want to show a label that is framed with a value that is justifield just so that the labels are all on the left and the values are all right on the left.

    I tried:

     HorizontalFieldManager row1 = new HorizontalFieldManager();
            LabelField l1 = new LabelField("Linked:  ");
            LabelField l2 = new LabelField(
                    (theApp.getIsLinked()?"Yes":"No),
                    Field.FIELD_RIGHT);
    
            row1.add(l1);
            row1.add(l2);
            add(row1);
    

    That did not work.  I also tried a few other things but can't seem to make it work.

    Thanks in advance.

    Here you go:

    HorizontalFieldManager Row1 = new HorizontalFieldManager();
    LabelField l1 = new LabelField ("Linked:", LabelField.FIELD_LEFT);
    LabelField l2 = new LabelField ("No.", DrawStyle.RIGHT |) LabelField.USE_ALL_WIDTH);

  • Add HorizontalFieldManager to ObjectListField

    Is this possible?

    I think I came up with a solution that seems to work.

    Basically what I've done is created a class that extends HorizontalFieldManager.

    Inside of this, I outweigh the function of painting as follows:

        protected void paint(Graphics graphics)    {     if(this.isFocus())                        {         graphics.setColor(0x00FFFFFF);            graphics.setBackgroundColor(0x0000a8ff);      }     else                      {         graphics.setBackgroundColor(0x00FFFFFF);              }
    
           graphics.clear();     super.paint(graphics);        invalidate();       }
    

    Then I added the other managers / text boxes / bitmaps to the Senior Manager, but I got them all the non-focusable.

    Then I added * a * element focusable all at the bottom of the Senior Manager, but I did the actual height of the Senior Manager under then there, which shows that when this element received focus in the Senior Manager, the background color change, acting as a "hightlight. You can on this element features, then click send you to different screens or Watt, you want to do.

    My only question for now seems to be affecting all areas of text to a color once the Senior Manager is put in evidence... but im still working on it.

  • Newb question - displays only the first of several fields

    As a first application of Bb, I write a stopwatch and I want the larger time scale and the small milliseconds. As part of what I am trying to display several bitmap or label side-by-side fields, but when I run it using the Simulator, only the first is displayed.

    So, for example, what I want is:

    1-2: 3 4:5:6 7 8 9

    with each number in own field but what I mean is just

    1

    that is the first field. If I then use buttons they all appear in the verticalFieldManager by default in horizontalField Manager but if I use labels or bitmaps, then all I get is the first field, even if I remove the horizontalFieldManager and just use the default verticalFieldManager. I googled the question, this forum and spent several hours reading the code examples and documentation, but I have yet to understand why I can't put several fields of these types of side-by-side. I have to have something between them as separators or empty fields?

    The code that I've got so far is the following...

     public TimerView()    {     super();      HorizontalFieldManager timerField = new HorizontalFieldManager();
    
          Bitmap hour10 = Bitmap.getBitmapResource("num_1.png");        Bitmap hour01 = Bitmap.getBitmapResource("num_2.png");        Bitmap minute10 = Bitmap.getBitmapResource("num_3.png");      Bitmap minute01 = Bitmap.getBitmapResource("num_4.png");      Bitmap second10 = Bitmap.getBitmapResource("num_5.png");      Bitmap second01 = Bitmap.getBitmapResource("num_6.png");      Bitmap ms100 = Bitmap.getBitmapResource("num_7.png");     Bitmap ms010 = Bitmap.getBitmapResource("num_8.png");     Bitmap ms001 = Bitmap.getBitmapResource("num_9.png");     Bitmap colon = Bitmap.getBitmapResource("Colon.png");
    
          BitmapField bfHour10 = new BitmapField(hour10);       BitmapField bfHour01 = new BitmapField(hour01);       BitmapField bfHourColon = new BitmapField(colon);     BitmapField bfMinute10 = new BitmapField(minute10);       BitmapField bfMinute01 = new BitmapField(minute01);       BitmapField bfMinuteColon = new BitmapField(colon);       BitmapField bfSecond10 = new BitmapField(second10);       BitmapField bfSecond01 = new BitmapField(second01);       BitmapField bfSecondColon = new BitmapField(colon);       BitmapField bfMs100 = new BitmapField(ms100);     BitmapField bfMs010 = new BitmapField(ms010);     BitmapField bfMs001 = new BitmapField(ms001);
    
          timerField.add(bfHour10);     timerField.add(bfHour01);     timerField.add(bfHourColon);      timerField.add(bfMinute10);       timerField.add(bfMinute01);       timerField.add(bfMinuteColon);        timerField.add(bfSecond10);       timerField.add(bfSecond01);       timerField.add(bfSecondColon);        timerField.add(bfMs100);      timerField.add(bfMs010);      timerField.add(bfMs001);
    
            add(timerField);  }
    

    I know that this code violates probably some best practices or standards, but I intend to clean later.

    -edited for spelling

    Give it a go with images of the numbers.  You have it easy with BitmapFields, because you know how much space they need with

    getPreferredHeight() and getBitmapWidth().  Then you should be able to stick them next to each other.

    If I was doing this and who are looking for a special look at the clock, which seems to be what you are doing, I would like to have the digital icons as you do, and then set an image large enough to hold the value of the clock and in my routine of painting, select draw digital icon proper, in the right place.  As long as you load the bitmaps only once, I think it's the most effective way to do it.

    Of course, a much simpler way would be to have just a RichTextField formatted as you suggest - RichTextField because you can have two different fonts in a single field.

Maybe you are looking for

  • Relocation of the archives to a new folder becomes 68.3bMB?

    A lot of existing Archives in new cases, began the movement then discovered that once they were in the new folder, they are grayed out in Media Import of the FCP and would not load. Then after moving their return out of the folder, discovered that th

  • HP deskjet series of 1510 does not print

    We recently mloved to la Gomera (Canary Island) and there I bought an hp deskjet printer 1510. It will not print when connected to my laptop, also a HP with Windows vista, although it is connected, is on and is the default printer. I tried everything

  • Windows 7 64 Ethernet

    I have a computer laptop dv6t 7300 Envy, whit a wlan radio 2230bnhmw.i simply change the Windows 8 operating system for windows 7, I found the wireles driver intel, but I can not find the ethernet driver and the Device Manager does not show me anithi

  • Lower center of the screen limits heats up

    Hello The lower central part of the limit of the screen of the Lenovo 3000 N100 heats, before (screen) and rear (coverage). I noticed that back this area has a crack. What is the solution, what I need to change the screen or cover or just need to clo

  • How can I reset my password without a reset disk or flash drive?

    For some reason, I was prompted to change my administrative password.  I changed and forgot it.  I am trying to reset the password, but I do not have a reset disk/flash drive, and it is there no CD-ROM/DVD-ROM on the computer.  There is an administra