EditField & ButtonField on the same line

First of all, I would like to apologize in advance if there is already a resolution for this problem, I searched google on and off for a few days while working on other parts of my application, but have been unable to find advice.

I'm not new to programming, but I am relatively new to java and very new to the BlackBerry that's why I worked on something relatively simple, so I can get used to the user interface of programming programming.  A question, I have been unable to solve is how to place an EditField and a ButtonField on the same line with ButtonField sitting against the margin and right the EditField take the place of the left margin at the beginning of the ButtonField.  Graphically, that's what I'm trying to achieve:

| [- EditField-] [- ButtonField-] |

I tried to place the two fields inside the same HorizontalFieldManager and placing each field it contains is own Vertical or HorizontalFieldManager.  I also tried to use the FIELD_LEFT / FIELD_RIGHT styles, but can not find a way to stop the EditField of push of the ButtonField off the screen and using the width of the entire line for himself.

I begin to suspect that I need to learn how to code a custom field Manager, this is the case, or is there something much more simple that I'm missing?

Thanks in advance,

Russ.

The following Threads must explain what is happening here and give you example of code that will help you overcome the problem:

http://supportforums.BlackBerry.com/T5/Java-development/BasicEditFields-won-t-show-up-in-HorizontalF...

http://supportforums.BlackBerry.com/T5/Java-development/custom-field/m-p/392585#M76156

Tags: BlackBerry Developers

Similar Questions

  • EditField and checkboxfield on the same line

    public CheckFileScreen()
        {
            vfm = new VerticalFieldManager();
            left = new HorizontalFieldManager( Field.FIELD_LEFT);
            right = new HorizontalFieldManager( Field.FIELD_RIGHT);
            _Id = new EditField("Id : ", "", 6, EditField.FILTER_NUMERIC);
            _check = new CheckboxField("check", false);
                    left.add(_Id);
            right.add(_check);
            vfm.add(left);
            vfm.add(right);
            add(vfm);
            add(new SeparatorField());
        }
    

    on my above code tries to _id and _check on the same line, but the screen has been mess up

    +---------------

    | ID:

    | # check

    +----------------

    I want to create has been

    +----------------------

    | ID: # check

    +-----------------------

    could someone help me with this?

    This is the first time make app with GUI

    Gentlemen.

    slow down, please!

    Absolutely, totally useless any Manager available personalized for that! In order to organize two or more fields in a 'line', you just all of them to the same HorizontalFieldManager! The manager then places them from left to right in the order that you add them.

    That said - you have a slight problem in your EditField. EditField is "width-hungry" - it consumes the entire width, it is given, do not leave anything for the rest fields. To combat that, to deceive him into thinking he's got less space. We will give him what he needs to label 6 larger figures (s '8' or '9's, not '1') and a space for the padding. We will then have something like:

    _Id = new EditField("Id : ", "", 6, EditField.FILTER_NUMERIC) {
      protected void layout(int width, int height) {
        Font myFont = getFont();
        int myWidth = myFont.getAdvance(getLabel()) + myFont.getAdvance("8") * 6 + myFont.getAdvance(" ");
        super.layout(Math.min(myWidth, width), height);
      }
    };
    _check = new CheckboxField("check", false);
    HorizontalFieldManager hfm = new HorizontalFieldManager();
    hfm.add(_Id);
    hfm.add(_check);
    add(hfm);
    

    Enjoy!

  • How to put the button on the same line

    I am having some problems with the buttons. I have the main screen with a verticalmanagerfield parent, who has two sons a richtextfield and an editfield (these two are the same on both of the gpsdemo)

    I want to put 3 buttons under the sons of two field and these 3 buttons that we're going to be son of verticalmanagerfield, but I can't put them on the same line

    I'll show you two pictures what I mean

    first image: I see now

    second image: what I want

                HorizontalFieldManager hfm = new HorizontalFieldManager()
                {
                    protected void sublayout(int width, int height)
                    {
                        Field field;
                        int numberOfFields = getFieldCount();
                        int x = 0;
                        int y = 0;
                        width=250;
                        height=50;
    
                        for (int i = 0;i < numberOfFields;i++)
                        {
                            field = getField(i); //get the field
                            setPositionChild(field,x,y); //set the position for the field
                            layoutChild(field, width, height); //lay out the field
                            x += 120;
                        }
                        setExtent(width, height);
                    }
                };
    
                 hfm.add(new ButtonField("Button 1"));
                 hfm.add(new ButtonField("Button 2"));
    
  • What happened to the insertion function. It was on the same line as file

    What happened to the insertion function? It was on the same line as the files, tools, etc. He's gone. If you want to insert a jpg you sent as an attachment. I have read through the help files and that you can't find the answer. I want my old Thunderbird back! Newer is not always better.

    I suspect that you have lost the Mail composition toolbar. Open an entry window, press and hold the < alt > key, type v and check the box for the mail toolbar. I would also allow the Menu bar while you are there.

    Another possibility, if the Insert option is missing in the mail toolbar, is that it is spent in composition in plain text mode. Open the settings page of the account assigned by right-clicking on the account in the left pane, select Composition & addressing and tick the box labelled "Dial using the HTML format".

  • view edit history file on the same line as the Favorites bar

    I used customize to try to remove: file edit view etc. in the bookmarks toolbar I have somehow manged to get on the same line. I don't want it and want to remove it.

    Hi, try clicking on settings by default, as shown in the controls, buttons, and Toolbars Customize Firefox. There are also instructions to remove the bar of menus (file, editing, display etc.).

    If your question is resolved by this or another answer, please take a minute to let us know. Thank you.

  • How can I combine the navigation bar and the menu bar on the same line to save space?

    V29 Firefox seems to be a huge not backward in customization. I need to save room for the content so already I disabled the tabs and combined in the menu bar and the navigation bar on the same line. The url space is too long anyway. Now with v29 all my customization is gone and I can't get it back. I can move me is more points on the navigation bar to combine it with the menu bar. Why this was done? It limits only my ability to customize my browser? I'm very frustrated that you had a great browser and ruined.

    You should see Classic theme restaurateur, it contains many parameters. This module applies to customize Firefox 29. https://addons.Mozilla.org/en-us/Firefox/addon/classicthemerestorer/

  • The orange Firefox button and the Navigation toolbar is on the same line

    Someone interfered with my Firefox settings and goofed a bit. Now the orange Firefox button and the Navigation toolbar are on the same line/line, as shown in the image below. Can you help me with the Firefox orange button at the top of the Navigation toolbar (as usually is the case)?

    http://PUU.sh/4NoO8.jpg

    Thank you very much! I had this same problem. I'd rather have my tabs at the top, in line with the orange. For some reason any that an add-on reset my 'browser.tabs.drawInTitlebar' to false, which looked horrible and wasted a whole bar of space by the presence of a large space empty on the top of my screen. It fixed my problem!

  • I want the address bar so that my bookmark bar can show more than three icons when it is placed on the same line.

    I have about five to ten icons bookmark in the same line as the search and address bar. So I use customize... and I put the bookmarks on the same line bar. I leave the "name"-textbox in each bookmark in white so that only the icons. ""

    However, only two icons appear and the rest are displayed in a drop-down list with an arrow you click.

    I need not address bar to take 70% of the screen. I don't want the bookmarks bar to use an additional line. I just want to have the icons of bookmark five to ten next to my search and address bar. Is this possible?

    The address bar and the search bar, that both have a flex attribute that makes then take all available space.

    Items in Bookmarks Toolbar folder probably has a minimum width that can just make a bookmark with a maximum length label (in your case two icons).

    You can set the width of the address bar and the search bar to force a maximum width of these two bars max.
    Definition of a minimum width for the bookmarks toolbar items will probably work as well.

    Add code to the file userChrome.css below default @namespace (setting the width according to your needs).

    Customization files (interface) userChrome.css and userContent.css (Web sites) are located in the chrome folder in the user profile folder.

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    
    #urlbar-container { max-width: 400px !important; }
    #search-container { max-width: 200px !important; }
    

    You can use this code to set a minimum width for bookmarks toolbar items if you want to experiment with that.

    You may need to set a width max as well.

    #personal-bookmarks { min-width: 200px !important; }
  • How can I leave toolbars 2 (or more) share the same line?

    I would like to have 2 or more toolbars that do not have an entire line share the same line (such as MS Word or Acrobat Reader).
    Is this possible?

    See this KB article - https://support.mozilla.org/en-US/kb/customize-firefox-controls-buttons-and-toolbars

    Experiment with these toolbars and see what is possible with these specific toolbars. Firefox has this capability, most of the time, but each developer toolbar must provide the coding of their add-on to enjoy what Mozilla has integrated into Firefox.

    My guess is that a well made toolbar add-on has three times the code that has a toolbar add-on minimum effort. Too many developers toolbar these days take the easy way and do not have their add-on to be "flexible".

  • The orange button Firefox used to be on the same line as tabs, how to move the tool bar of tabs to be on the same line as before?

    I now have the Firefox button orange on its own line at the top of the page, but it used to be on the same line as the toolbar tabs which takes less space. I know what happened before I put right but cannot get back them now on a single line.

    Make sure that you have selected cover via Firefox > Options.

    You also have to maximize the window to have the tab bar and the Firefox button in the title bar.

    You can also set the pref browser.tabs.drawInTitlebar Boolean to true on the topic: config page.

  • I tried for AN HOUR to find a way to put the two different fonts on the same line

    Pages is crap. I tried for AN HOUR to find a way to put the two fonts on the same line, even if I highlight 1 WORD, the whole line changes (if you know how to do that please tell me, I'll me CRAZY!). Wouldn't recommend, that Word is 100 x better and easier to use

    < published by host >

    Hi varn,.

    Seems to work here (Pages of screen capture):

    Select (highlight) the text you want to change. Click on the Format brush, and then click Style. Choose the font you want to use.

    The example above is in the text layer. I also tried in a text box and a table cell.

    I also tried to change the font for a single word of a line of text in Pages for iOS. The police has changed to the selected word, while the rest of the line remained in the police, he had previously.

    Cannot test it in 5 Pages, because I have not installed. The above example is Pages ' 09.

    It is possible that you have applied to a paragraph Style, what would change everything in the paragraph containing the insertion point.

    Kind regards

    Barry

    PS: MS Word is available for OS X, if you feel the need to switch.

    B

  • Please explain CVI question #335358: using the operator of bit-shift twice on the same line of code produces incorrect results

    Hello

    I just stumbled on http://www.ni.com/white-paper/12323/en#335358_by_Category.

    With the help of the bit-shift operator twice on the same line of code produces incorrect results.
    Workaround: Separate the operations of shift of two bits in two distinct lines of code.

    Reported Version: 9.0    Solved Version: N/A    Added the: 14/02/2012

    Could someone please explain what kind of construction causes such a question?

    I have not noticed problems again and not have not noticed or found a thread about it.

    Thank you.

    The reported scenario looks like this:

    unsigned int a = 1, b = 62;
    unsigned  long long result = 1ULL << a << b;
    

    The problem arises because of the temporary variable used when do two little is placed in the same line. This separation into two lines will produce correct results:

    unsigned int a = 1, b = 62;
    unsigned  long long result = 1ULL << a;
    result = result << b;
    
  • On my laptop, my google toolbar sharing the same line with the menu bar, I want that on my desktop PC, all have XP w/SP3

    On my Toshiba laptop that my Google toolbar is on the same line as the menu bar, I want that on my Dell desktop computers. All have Xp w/SP3. All computers are olde, and I am rich with time, but poor in cash. Thanks - L

    Hello

    What version of internet Explorer that you are using?

    You can unlock the toolbar then click, hold and drag the toolbar on the same line of the menu bar.

    Unlock toolbars to customize their

    Hope the helps of information.

    Please post back and we do know.

  • 2 phones connected to the same line with PAP2

    Hello

    Is it possible to connect a phone to the first port, a second, and use both in the same line?

    I configured and only works with a single line.

    Thank you

    Yair.

    Hello

    No, this is not the right way. The first port belongs exclusively to recording the line1, second port exclusively to recording of line 2.

    If you want two phones (such as another in the bedroom lounge) ringing on incoming call, simply use the "splitter" to make the phones at the same time and that's it - SPA/PAP Traffic has enough power to operate up to 3 analog telephone devices on each of the ports. I used to have 2 analog phones in parallel on (the only one) FXS ports of SPA-1001 and it works beautifully.

    PS: mae good course use you only 2-wire cable (internal thread) to connect the PAP2T FXS1 port and the phone (s). The 4-wire cable may make some analog phones crashing the device PAP2T IDE oucederomsurlesecondport FXS1.

  • 3 Jpeg files on the same line of document

    I've inserted 3 jpeg files into a document and can not group or move.  I reduced the margins to try to spread out so I could keep all files 3 JPEG on the same line in the document, but can't seem to do anything back.  Any suggestions?

    Hello

    What program you use to edit the document?

    If you are using an Office application, and then publish your request on the Microsoft Office support forums.

    http://answers.Microsoft.com/en-us/Office

    If you use another program, and then provide us with more information.

    Kind regards
    Afzal Taher
    Microsoft technical support engineer

Maybe you are looking for

  • How do you know if that he is in charge. No light

    is there a way to say that the TV remote is charging. I do not see a light

  • Can put photos into individual folders?

    I like to organize my photos and put them in different folders, e.g. friends, family, pets... How can I do this? I thought 'my pictures' and 'images '. I tried to download images & their files from my old phone to my computer for the backflip and non

  • iPhone 4 wrongly restored

    Hello I'm in a great upheaval. I use an iPhone 4 with 7.1.2 but never saved. Today I connected to iTunes and when he asked to "use as new" or "restore under...". "I restored it as my other iPhone. I have sms/s very important in my iPhone. I don't wan

  • DNS server does not!

    DNS SERVER, ŒUVRES FOR A WHILE AND THEN STOPPED RESPONDING, REPLACED BRAND NEW MODEM, I HAD THE SAME PROBLEM. Please help if you can!

  • To disable filter keys.

    Original title: keyboard and filter keys use. Filter keys come on every time I log on computer that seems to cut off my laptop keyboard and my external keyboard. HELP, how do I get this to stay off?