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!

Tags: BlackBerry Developers

Similar Questions

  • CheckboxField, on the same line with OS6

    Hello

    I'm testing my apps for compatibility with OS6.  I discovered that if I have more controls, and then another on the same line, behavior went from OS5.  The first control's display while the other controls are moved outside of the screen.  Any idea on how to solve this problem while keeping compatibility?  Here's the code I'm referring to:

    HorizontalFieldManager hfmOperator = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);
    
    int intRightSpace = Display.getWidth()/10;
    
    LabelField lblOperator = new LabelField("");
    lblOperator.setFont(Font.getDefault().derive(Font.PLAIN, 18));
    lblOperator.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(lblOperator);
    
    chkADD = new CheckboxField("+",  Param.boolActiveADD);
    chkADD.setFont(Font.getDefault().derive(Font.PLAIN, 24));
    chkADD.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(chkADD);
    
    chkSUB = new CheckboxField("-",  Param.boolActiveSUB);
    chkSUB.setFont(Font.getDefault().derive(Font.PLAIN, 24));
    chkSUB.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(chkSUB);
    
    chkMUL = new CheckboxField("*",  Param.boolActiveMUL);
    chkMUL.setFont(Font.getDefault().derive(Font.PLAIN, 24));
    chkMUL.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(chkMUL);
    
    chkDIV = new CheckboxField("/",  Param.boolActiveDIV);
    chkDIV.setFont(Font.getDefault().derive(Font.PLAIN, 24));
    chkDIV.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(chkDIV);
    
    add(hfmOperator);
    

    The only way I could get to this day is to override the method of layout in the CheckboxField and spend a fixed width to the super method:

    protected void layout(int width, int height) {
        super.layout(100, height);
    }
    

    The problem with this approach is that the width of the content can vary from a device to according to the size of font by default, etc. and it may be possible to try to force a specific width.

  • left and right justify the same line of RitchTextField

    Hello

    How to justify to the left and to the right the same line of text...

    There is no way to do currently - DrawStyle.HFULL is listed as "not yet implemented" (I wonder about this 'yet' - there is no more BB OS versions after 7.0, is there?)

    If you want to achieve, you will have to be implemented by program (not too hard, but not trivial either).

  • How to better master with this model s/n, sides IN and OUT in the same line.

    Hi all!
    I'm just facing some old historical table where, to the transaction recorded in the same line, something like:

    column name
    ==============
    ref_no,
    x_id,
    product_id,
    product_amt,
    -* IN part
    in_flag-(IN)
    in_customer,
    in_address,
    -* PORTION
    out_flag-(OUT)
    out_customer,
    out_address

    Nice shipping biz where we can have the two sides met in the same line, they have same value for IN and OUT_flag = actual values 'IN' and 'OUT', woou!
    I really expect to have this table in different model where a line is an entry, probably with PK = ref_no + in_out_flag.
    But it looks like I can do anything on this design, and now I choose upong xactions request entry and EXIT, IN/OUT fixing portions on a common part with the UNION. This, the only way I can see how to solve this problem, or I'm not right? And I need to pack all in the stored procedure.

    Appreciate your comments how to do this, I'm really new to Oracle, however have some exp.
    And comments about these models db as well! -).


    Best
    TR

    I don't understand what problem needs to be solved.

    What criteria an independent observer would conclude that a correct solution has been posted.

    Published by: sb92075 on September 11, 2010 17:19

  • Region HTML - element, TextBox and Button on the same line

    Hello

    I have a search page:
    POINT region HTML with a search box and a button (created in the section of button).


    How can I align the search box and the key? (on the same line)
    I see that the choice for the button to align at the top or on the button of the section. If the button is under or above the search box.

    Or maybye is possible to hide the searbox and button and create a table html for alignment?


    I work with Apex 3.1.2.00.02
    Region: HTML
    Theme: Dark blue:
    Model: region of report

    Thank you

    Roseline

    Roseline,

    Create a new button and select the Create button as an element and not in the position of the region.

    Option buttons behave differently to the buttons of the Position of the region.
    If you are wanting to use the button 'Submit' page, you need to change the button to target is a URL and add javascript:doSubmit('YOUR_REQUEST_VALUE');

    Gus...

    AWARDS: Don't forget to mark messages USEFUL or CORRECT on the forum, not only for my answers, but for everyone!
    ;-)

  • Difficulty accessing controls checkbox and textfield on the same line

    Hello

    Maybe someone can help me. I am having trouble getting a checkbox and a textfield on the same line. The new line, new field are both on 'n'. Using firebug I can see that the two elements are in the same < td > < table > tag.

    Unfortunately, the box is medium by a < fieldset class = 'checkbox_group' > < / fieldset > tag. And despite the fact that I changed the width of this class so that there is enough room, the textfield object begins on a new line (inside the < td > tag < table > even).

    Any suggestions?
    Kind regards
    Michiel

    You don't need to use JS to change the CSS!

    If you need to change the style for this page only, then put it in the header of the page

    that way if a bug will affect your JS that will defend no mater what and will be also much faster.

    Best regards
    Piotr

  • After you select list, and button on the same line

    Just a minor matter cosmetic a user has raised.

    I have a couple of selection lists that I have on the same line by setting the 'start on new line' on no. Is it possible to get a button to sit on the same line (i.e. within the same line of the table or cell as Select lists)?

    West Indies,

    When you create a button, the second page of the wizard is the option you're looking for: 'create a button displayed among the elements of this region. "

    Just keep in mind that these buttons don't submit by default where as area buttons can also redirect without submitting it.

    Kind regards
    Dan

    http://danielmcghan.us
    http://sourceforge.NET/projects/tapigen

  • DEP. and emp on the same line. pls help

    I want to output in two columns with the table emp and dept

    Col1: DetpNo
    Col2: Concatenated employee numbers separated by commas

    For example
    If dept contains

    1 electric
    2 mechanics
    3 comp

    Contanis table emp

    John 100 1
    200 Smith 2
    Cobb 300 1


    I need output like

    Col1 Col2
    1 100 300
    2,200

    Try this

    select deptno, rtrim(xmlagg(xmlelement(e,empno||',').extract('//text()')),',')
    from employee
    group by deptno
    /
    
  • EditField &amp; 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

  • 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!

  • Ipv4 and ipv6 on the same ACL line vty

    Hello everyone.

    I just want to confirm if I can protect a router (telnet and ssh) put 2 ACL (an IPv4 and other IPv6) on the same line vty. Something like:

    line vty 0 4 access-class hostsIPv4 in ipv6 access-class hostsIPv6 in

    I have to use named ACL?

    Thanks in advance

    Yes,

    You can do it.

    line vty 0 4

    access-class 60 in

    class to access acl-ipv6-IPv6, in

    transport input telnet ssh

    Kind regards

    Herbert

  • I'm creating a Web site and I want the objects to be on the same line, how would I do?

    I'm trying are we on the same line as the bar of navigation and put text in the empty box, can anyone help on how to do it please? I tried for days and nothing works...2016-04-04.png

    Assuming you have floated the container elements and you have the correct width to fit the main component/container, then you might want to take a look at Box Sizing | CSS-Tricks

    If this does not resolve your problem, please view the code.

  • How to align the product and the image of the product on the same line?

    ScreenHunter_217 Jan. 25 15.06.jpg

    I'm having a problem trying to make the image of the product and the title of the product to be on the same line. Can someone help me?

    To do this, right-click in this general area to 'inspect element' and change the display to "block" for the hidden liquid section. Who must disclose and thus allow you to activate and save.

    See screenshot below.

  • How can I keep right-aligned to left and paragraphs together on the same line?

    I am currently composing a menu. Basically, I want the title of dish to be aligned to the left and aligned price right, but on the same line. I can achieve the effect by typing in a shift + tab after the text of the title of the dish and then insert the price, but I'd rather have two styles of separate paragraphs, so that I can adjust the world to see what looks good. can I get the effect by adjusting the character of price from the price database and move it to the top, but then if I need to make changes in price, I find it a pain when trying to get the cursor in the right place in situations where a base line is significantly changed.

    Back in time (to Ventura!), I could just remove the line break after the style 'Dish title' and the 'price' would be upwards to the same line, but I can't seem to be able to do this to the CS6.

    Any ideas?

    You can use a table, but I think that a single paragraph with a character style nested to manage the different formatting for the price is more flexible.

Maybe you are looking for

  • Satellite A660 - cannot find drivers for Win 7

    I have a toshiba satellie 07u machine. but I can't seem to find the drivers for it on the site of toshiba for any other model... when I chose "computers" suppport page it won't let me choose the satellite... Please help It's the driver page...http://

  • Number of Build EXE programmatically

    I've seen discussions to find the Build number of the EXE using calls .NET or dll.  One of the latest versions of LabVIEW have this property built in (so that I could call him in my application)?  Looks like such a common need, do not know why it was

  • My icons on my shortcuts changed.

    My icons on my shortcuts changed. All my icons look like the e on enternet. I can't change back don't know how. Thanks anyone who can help.

  • New resolution (1440 x 1440) affect on OS 10.2

    With the release of the OS 10.3 I noticed that there is a new resolution (1440 x 1440) available. The app, I intend to create has all the features of the OS 10.3. Given the resolution it is preferable to develop for 10.3 or 10.2?

  • color of the very light slider

    The color of my cursor on the side and bottom of the screen is so light that I didn't. Almost transparent.  How can I change the color, or make it darker? Thank you in advance. -sid