Two RadioButton on the same line with any idea...

Hello

Can I add two RadioButton singel online...

I m using HorizontalFieldManager with him

but only the first button is visible... give me a solution simple and good for this please help me.

Thank you

Himanshu

Beginner

Please find the Code below and try it and let me know...

radioButtonGroup = new RadioButtonGroup();

        radioButtonField = new RadioButtonField("Radio 1", radioButtonGroup,
                true, 0) {
            protected void layout(int arg0, int arg1) {
                setExtent(Display.getWidth() / 2, arg1);
                super.layout(Display.getWidth() / 2, arg1);
            };
        };
        radioButtonField1 = new RadioButtonField("Radio 2", radioButtonGroup,
                false, 0) {

            protected void layout(int arg0, int arg1) {
                setExtent(Display.getWidth() / 2, arg1);
                super.layout(Display.getWidth() / 2, arg1);
            };

        };

        HorizontalFieldManager hfmFieldManager = new HorizontalFieldManager() {
            protected void sublayout(int maxWidth, int maxHeight) {
                setExtent(Display.getWidth(), maxHeight);
                super.sublayout(Display.getWidth(), maxHeight);
            }
        };

        hfmFieldManager.add(radioButtonField);
        hfmFieldManager.add(radioButtonField1);

        add(hfmFieldManager);

        add(new LabelField("This label is below the two radio buttons",FOCUSABLE));
        add(new ButtonField("Click ME!"));

Tags: BlackBerry Developers

Similar Questions

  • Mr President, how can I enter two rows at the same time with different default values that only the first line to use see?

    Mr President.

    My worm jdev is 12.2.1

    How to enter two rows at the same time with different default values that only the first line to use see?

    Suppose I have a table with four fields as below

    "DEBIT" VARCHAR2(7) , 
      "DRNAME" VARCHAR2(50),
      "CREDIT" VARCHAR2(7) , 
      "CRNAME" VARCHAR2(50),
    

    Now I want that when I click on a button (create an insert) to create the first line with the default values below

    firstrow.png

    So if I click on the button and then validate the second row with different values is also inserted on commit.

    The value of the second row are like the picture below

    tworows.png

    But the second row should be invisible. It could be achieved by adding vc in the vo.

    The difficult part in my question is therefore, to add the second row with the new default values.

    Because I already added default values in the first row.

    Now how to add second time default values.

    Concerning

    Mr President

    I change the code given by expensive Sameh Nassar and get my results.

    Thanks once again dear Sameh Nassar .

    My code to get my goal is

    First line of code is

        protected void doDML(int operation, TransactionEvent e) {    
    
            if(operation != DML_DELETE)
                 {
                     setAmount(getPurqty().multiply(getUnitpurprice()));
                 } 
    
            if (operation == DML_INSERT )
                       {
                               System.out.println("I am in Insert with vid= " + getVid());
                           insertSecondRowInDatabase(getVid(),getLineitem(),"6010010","SALES TAX PAYABLE",
                            (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                           }
    
            if(operation == DML_UPDATE)
                              {                                                    
    
                                 System.out.println("I am in Update with vid= " + getVid());
                             updateSecondRowInDatabase(getVid(),
                                 (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                              }                      
    
            super.doDML(operation, e);
        }
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "Insert into vdet (VID,LINEITEM,DEBIT,DRNAME,AMOUNT) values " +
                 "('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "','" + value5 + "')";  
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }
                  }  
    
                  private void updateSecondRowInDatabase(Object value1, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "update vdet set  AMOUNT='"+ value5+"' where VID='" + value1 + "'";                     
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
    
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }                  
    
                  }
    

    Second line code is inside a bean method

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");
                   RowSetIterator rsi = dciter.getRowSetIterator();
                   Row lastRow = rsi.last();
                   int lastRowIndex = rsi.getRangeIndexOf(lastRow);
                   Row newRow = rsi.createRow();
                   newRow.setNewRowState(Row.STATUS_NEW);
                   rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
                   rsi.setCurrentRow(newRow);
    
                   BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");
                   RowSetIterator rsi1 = dciter1.getRowSetIterator();
                   Row lastRow1 = rsi1.last();
                   int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);
                   Row newRow1 = rsi1.createRow();
                   newRow1.setNewRowState(Row.STATUS_NEW);
                   rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);
                   rsi1.setCurrentRow(newRow1);
        }
    

    And final saveUpdate method is

        public void saveUpdateButton(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindingsBC = BindingContext.getCurrent().getCurrentBindingsEntry();      
    
                   OperationBinding commit = bindingsBC.getOperationBinding("Commit");
                   commit.execute(); 
    
            OperationBinding operationBinding = BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit");
            operationBinding.execute();
            DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("VdetView1Iterator");// write iterator name from pageDef.
            iter.getViewObject().executeQuery();  
    
        }
    

    Thanks for all the cooperation to obtain the desired results.

    Concerning

  • Two RichTextFields on the same line

    I am writing two RichTextFields in the same line, but one of them with a font in bold and plain text for the other. I do this, but for some reason any the second richtextfield is not shown in my screen. I have no idea what I'm doing wrong...

    myFontNegrita = Font.getDefault () .derive (Font.BOLD, 16);
    myFont = Font.getDefault () .derive (Font.PLAIN, 16);
          
    hfmHoraInicio = new HorizontalFieldManager();
    labelInicioAplicacion = new RichTextField ("my text:", Field.READONLY |) Field.NON_FOCUSABLE);
    labelInicioAplicacion.setFont (myFontNegrita);
           
    textoInicioAplicacion = new RichTextField ("blablabla", Field.READONLY |) Field.NON_FOCUSABLE);
    textoInicioAplicacion.setFont (myFont);
           
    hfmHoraInicio.add (labelInicioAplicacion);
    hfmHoraInicio.add (textoInicioAplicacion);

    Add (hfmHoraInicio);

    Thanks in advance.

    I guess that the RichtTextField takes all the available horizontal space by default. Perhaps the style RichtTextField #USE_TEXT_WIDTH help?

  • How to paint two ObjectChoiceField on the same line

    Hello Experts!

    I tried to draw two ObjectFieldChoice on the same line, but the work doesn´t, I found this post that have the same problem as me, but the fix doesn´t works for me.

    My code:

    ...
                      String[] tipos = new String[] {"BLA1", "BLA2" };
            _tipo = new ObjectChoiceField(null, tipos, 0, FIELD_VCENTER) {
                protected void layout(int width, int height) {
                    super.layout(width - 235, height);
                }
            };
            _tipo.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1)));
            _tipo.setFont(Utils.getFont());
    
            FCLabelField lblTipo = new FCLabelField(_tipo_filtro, FIELD_VCENTER, false);
    
            String[] opcoes = new String[] { "BLA3", "BLA4", "BLA5", "BLA6"};
            _situacao = new ObjectChoiceField(null, opcoes, 0, FIELD_VCENTER) {
                protected void layout(int width, int height) {
                    super.layout(width - 346, height);
                }
            };
            _situacao.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1)));
            _situacao.setFont(Utils.getFont());
    
            FCLabelField lbl = new FCLabelField(_filtro, FIELD_VCENTER, false);
    
            CustomButtonField btConsultar = new CustomButtonField("Submit");
            HorizontalFieldManager hfmButton = new HorizontalFieldManager(FIELD_VCENTER);
            hfmButton.add(btConsultar);
    
            HorizontalFieldManager hfm = new HorizontalFieldManager(FIELD_LEFT);
            hfm.add(lblTipo);
            hfm.add(_tipo);
            hfm.add(lbl);
            hfm.add(_situacao);
                      add(hfm);
    ...
    

    I m waitting for more help.

    Best regards, Rampelotti

    The way I would approach this scenario is firstly by adding two fields of object list to a horizontal management.

    Resize the fields until they are exactly where you want to be.

    Once you did, then you can begin to add the label fields, centering, resizing and so on.

    Do it step by step.

    Also subtract 200 + pixels in width is not a good idea, especially on small devices.

    Hope this helps

  • Hello, my parents computer came RAM volume0 has failed and not be able to start. We went and brought a new hard drive, and its always say the same thing. Any ideas?

    Hello, my parents computer came RAM volume0 has failed and not be able to start. We went and brought a new hard drive, and its always say the same thing. Any ideas?

    A message on the RAID 0 volume failed is a recognizable error message, but the news is not good.

    RAID, by its nature, requires 2 or more drives.  RAID = redundant Bay of independent (or inexpensive) disks

    RAID 0 is the worst of the different RAID choices.  It increases the performance of hard disk by spreading or striping, data on two disks so that he can read and write more quickly. Unfortunately, such a picture offers no protection of data - in fact, it increases the chances of loss of data since the failure of a disk in the array results in the loss of all data on both drives. RAID 0 configurations are standard on high-end and PCs graphics games and provide a performance gain measurable, albeit modest for games, graphics applications and other programs intense from the hard drive.

    In view of the foregoing, the best course of action for you and your parents is to take the computer to a local computer professional - not a type of place BigBoxStoreUSA or GeekSquad.

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

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

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

  • Question about running from two cameras at the same time with MAX

    Hello

    I have two cameras attached to NI PCIe-1430 frame grabber card (Atmel Aviiva M2 CL and Fairchild 2 K LS) IRLS. It's ok when I run two cameras individually, but I can't run them at the same time.

    This is the step that simultaneously run two device:

    1. open MAX, select the port and start image acquisition by pressing the 'Grab' button, I can see the image at this point.

    2. open another MAX session, select the other port and press "enter". I got following error:

    "Error 0xBFF60021".

    Unable to perform request; acquisition in progress'

    Sometimes, I got this error too:

    "Error 0xBFF60022".

    A timeout error occurred while you wait for the specified event. If you expect a picture, check the video data is acquired in the period. If in the meantime the signal, check that the assertion of signal has occurred within the period. »

    I already give enough timeout Fame to the tab settings of Acquisition.

    The MAX version used is 4.5.

    You have an idea on that? Makes simultaneous Imaging MAX support?

    Thank you

    -polarfox

    Thanks for the quick response Bruce.

  • I have two folders in the same subdirectory with the same name. How to remove the extra folder?

    I have 2 directories "documents" located in the same directory. They are as well located in C:\Documents and Settings\ [user_name]------directory. Duplicate folder is automatically updated with the same file names when I add files in the original folder. It looks like a pointer to the original folder, when I try to delete the duplicate directory. I get the following error message.

    Can't delete My Documents: it is used by another person or program.
    Close all programs that might be using the file and try again.

    I deleted all files in the directory, rebooted the computer and attempted to delete the now empty folder and I get the same error message. Can you help me remove this duplicate folder.

    Note:
    ------

    I am not able to rename the duplicate folder... If I try to rename, the original folder is renamed... But not the duplicate. Also the duplicate folder becomes empty (since it runs a pointer to the original folder, when the double original of renowned gets is empty)

    Mager

    In Windows XP, all user folders were located under the C:\Documents and Settings folder.

    In Vista , all user folders are located under the folder C:\Users .

    Vista Documents and Settings folder is not a real file it's a junction folder that points to the Folder C:\Users.

    A junction is as a shortcut that points to another file, that is why these records have a shortcut (arrow) overlay icon. In Vista, the only reason why the Documents and Settings junction is for the old installers who are looking for a Documents and Settings folder. When they try to access the folder Documents and Settings, the junction in silence re - runs Setup to the C:\Users folder.

    The default permissions for the Documents and Settings junction is access denied, even for the administrators of .

    The only way that a user can access this file actually is if the access permissions have been changed.

    For a more detailed description of this topic and a list of all the junctions see the following Web site.

    Windows Vista Junction Points:
    http://www.Svrops.com/Svrops/articles/jpoints.htm

    I recommend that you move all your files and immediately stop using the Documents and Settings folder to avoid more problems.

    If this just started recently, I recommend that you use the system restore back to a point before the documents and settings folder was first access.

    Ronnie Vernon MVP

  • With Creative Cloud, can run us applications on two computers at the same time?

    Hello

    (First Question):

    I have two diffrant PC with the same OS (Windows 7),

    can I use any application on the two PCs at the same time with my plan full creative cloud for individuals - annual.

    ((Deuxième Question):

    If the answer to my question above is yes then my second question is that I use my laptop at home, except office hours so it is possible

    to install creative cloud on my third machine (Windows - computer laptop at home).

    Example: Can I use Creative cloud when I am connected at home and not in the desktop.

    First question: Yes

    See Q3 in respect of development underway in the FAQ

    http://www.Adobe.com/products/creativecloud/FAQ.html

    Second question: not easily.

    Your cloud membership entitles you to 2 simultaneous activations only max.

    To use it on the 3rd computer, you should disable first on the desktop computer. Then re-enable the next day.

  • 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

  • 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

  • Run different applications in Creative Suites on two computers at the same time.

    I have a backlog of mini tape DV from my vacation for 10 years.  The rear reason is because slow computers have made a personal production until the very slow DVD creation.  I've recently updated to 4-core i7 with unique HDs and on the point of buying a custom built 6 hearts i7 with SSD and RAID HDs.  I understand that I can install Creative Suite Production Premium 5.5 on two computers.  One facility is already on the coreI-4.   I intend to install the second installation on the 6-core.  I would use the 6-core for production, while the 4 - core is the capture of DV cassettes.

    If I had bought a copy of an application separate and installed on separate computers, I'd be able to run them at the same time.  Is there a way I can run two computers at the same time with Creative Suite to accelerate personal production for example can I run separate from the Creative Suite applications, I want to use separate programs, on two computers at the same time, as long as these requests are not the same?

    You can run the same or different adobe products to the same or different times on the same or different computers (except that you can not run the same program more than once on the same computer at the same time).

  • Win7 with FF 31, smart phone 4.2 with FF letest ver. using the same account with 1 email. But the phone is not getting any collar, Bokmr, etc.

    Brother.
    We use win7 with Mozila 31, 4.2 with Mozila Android smart phone latest google app store on 04/10/0214. Using the same account with the same email. But the phone does not get any new information of win7 with Mozila 31. PL z give useful information.

    Hi w3ur_team,
    Thank you for your question. I understand that there are two features that are documented in the sync account. However the Android is not synchronized.

    There are two places we can check:

    1. In the Android settings, under accounts is the Firefox Sync or Firefox Sync (discouraged) joint account?
    2. Credentials work on accounts.firefox.com on the mobile device and are there any error messages in the synchronization of the settings menu > sync?

    See also Firefox Sync troubleshooting and tips for more troubleshooting steps.

Maybe you are looking for