Problem with the dialog box displayed when the RadioButton is selected.

It is an application with 3 buttons button1, radio 2 and output key that uses System.exit (0)
The problem is with the dialogs first two buttons

1. I open the application

2 Select a radiobutton, I get a dialog box, I click 'ok', dialog will, that's fine.

3. I choose an another radiobutton button1 or button2, I get the corresponding dialog, BUT know I have to click 'ok' twice to keep it alive.

I don't know what could be the problem, here is the code:

package com.thinkingblackberry;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.PasswordEditField;
import net.rim.device.api.ui.component.RadioButtonField;
import net.rim.device.api.ui.component.RadioButtonGroup;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.component.Status;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.component.PasswordEditField;

public class HelloWorldScreen1 extends MainScreen implements FieldChangeListener, DrawStyle {

    protected static final int RED = 0;
    MButtons fullscreen;
    //protected RadioButtonGroup rbGroup= new RadioButtonGroup();
    public HelloWorldScreen1() {

        final RadioButtonGroup rbGroup=new RadioButtonGroup();

        setTitle("Application");

        RadioButtonField rbField= new RadioButtonField("RadioB1"){

            protected void paint(Graphics g){
                g.setColor(Color.ROSYBROWN);
                super.paint(g);
            }
        };
        RadioButtonField rbField2= new RadioButtonField("RadioB2"){
            protected void paint(Graphics g){
                g.setColor(Color.SIENNA);
                super.paint(g);
            }
        };
        RadioButtonField rbExit=new RadioButtonField("Exit"){
            protected void paint(Graphics g){
                g.setColor(Color.DARKSLATEBLUE);
                super.paint(g);
            }
        };;
        rbGroup.add(rbField);
        rbGroup.add(rbField2);
        rbGroup.add(rbExit);
        add(rbField);
        add(rbField2);
        add(rbExit);

        rbGroup.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(Field field, int context) {
            if (rbGroup.getSelectedIndex() == 0) {
                Dialog.inform( ""+rbGroup.getSelectedIndex());

            }
            else if (rbGroup.getSelectedIndex() == 1) {
                Dialog.inform( ""+rbGroup.getSelectedIndex());
            }
            else if(rbGroup.getSelectedIndex()==2){

                System.exit(0);
            }

            }
        });

    }

    public HelloWorldScreen1(long arg0) {
        super(arg0);
    }

    public void fieldChanged(Field field, int context) {

    }

}

I guess the event changed field is called twice, once deselection button1 and once to select button2. you pay your processing logic to account for this.

Tags: BlackBerry Developers

Similar Questions

  • [ReachIt] The copy files dialog box display when trying to choose a local application to open the video file

    Install ReachIt 2.0.5.2, navigate to the video folder, select a video file and click Open with-> local application, then the display of the dialog 'Copy files', don't know the reason.

    It's like the design, we will copy the file to the folder local reachit before you can share with shareit. Thank you

  • Problem with custom dialog box

    I have a custom dialog box. The code goes here

    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    
    public class CustomDialog extends Dialog{
    
        public CustomDialog(int command,String msg,int color,int alpha){
             super(command, msg, command,Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), VerticalFieldManager.FOCUSABLE);
             setBackground (BackgroundFactory.createSolidTransparentBackground (color, alpha));
        }
    
    }
    

    I'm the caller to another class as follows

    CustomDialog d = new CustomDialog(Utils.D_YES_NO,"Do you want to exit",Color.BLUE,140);
    d.show();
    

    Its display very well and as I intended it to be. But the problem is that I'm not able to get the index of the choice to perform certain actions, such as

        int i=d.getSelectedValue();
    
                        if(i==Dialog.D_YES){
                            Dialog.alert("hi");
                        }
    
                        }
    

    Its do not call the dialog box, can anyone suggest me how to get the index of the choice that I chose to say YES or NO and to perform tasks accordingly

    Plese try suite

    CustomDialog d = new CustomDialog(Dialog.D_YES_NO,"Do you want to exit",Color.BLUE,140);
                    d.show();
                    d.setDialogClosedListener(new DialogClosedListener() {
    
                        public void dialogClosed(Dialog dialog, int choice) {
                            /*
                             *   // Field descriptor #211 I
                                  public static final int YES = 4;
    
                                  // Field descriptor #211 I
                                  public static final int NO = -1;
                             */
                            int i=choice;
                            System.out.print("Selected Value :"+choice);
                            if(Dialog.YES==choice){
                                System.out.println("Selected Value : YES");
                            }else if(Dialog.NO==choice){
                                System.out.println("Selected Value: NO");
                            }
    
                        }
                    });
    

    If it is useful, please make as response and do not hesitate on LIKE button thanks

  • I have a problem with the can not select laserjet 3500.

    I have a new HP running Windows 8 and installed the driver for the Laserjet 3500 but it does not appear with the other printers and I can't select it manually, any ideas?

    Hello

    I would like to you see this article-

    http://h20000.www2.HP.com/bizsupport/TechSupport/document.jsp?lang=en&cc=us&ObjectID=c00045737

    We know if it helps.

  • better integration with the Mavericks. Still a problem with the display of the menu bar spaces when moved

    Much better integration with the OSX mavericks on the latest version. Without a doubt ahead of Parallels in terms of dual display/full screen. The menu bar has been resolved, but there is a ghost menu bar that appears when you move one space (fullscreen vm) from one monitor to the other. It resembles a translucent bar on top and without words. But clicking on it shows menus as if it is supposed to be links there.

    Yes, it is a known problem with the Mavericks Developer Preview; We work closely with Apple to find a solution. So far, we have seen only with the restoration of the window or when you move the window between monitors - if you leave full screen and enter again, it should work fine. If you notice any others, please let us know.

  • I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because that box "email".

    I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because the 'email' box keep rejecting their email address valid. And I just tried to remove the line in my form and it does not allow me to delete or to mark it as not necessary either.

    Currently, there is no way around the field email forms of the Muse. Another option is to have a look at Jotforms or another third-party provider of shape that Muse has widgets for.

  • Seeking help with a problem with the LR I use LR CC on a laptop, when you try to export a picture to an external hard drive, I am now without apparent reason to get the following message, "could not create a JPEG sponsor limit you 92 k Bytes.Plea.

    Seeking help with a problem with the LR


    I use LR CC on a laptop, when you try to export a picture to an external hard drive, I am now without apparent reason to get the following message.

    "Could not create a respondent JPEG limit you 92 k Bytes.Please increase the size limit files
    . (1).

    .....

    I tried to increase the size of the file several times,

    I left LR

    I restarted the computer.


    Any help or advice for this problem will be greatly appreciated


    Thanks in advance


    @stu

    Not because of the number of pixels, in this photo and the chosen level of quality there is no possible way to create a JPG file to the size of file you requested. You must change your export settings.

    Show us a copy of the export dialog box, so we can see clearly the part file setting and the size of the Image.

    Also indicate the number of this image (width and height) pixels after cropping (as appropriate) and prior to export.

  • Problems with the Display Mode target on end 2009 27 "iMac

    Used late 2009 iMac 27 "in the view target in conjunction with a Dell XPS tower with i7 processor, Windows 7 and the best graphics card I could afford at the time connected by HDMI to mini display port cable.  Worked well for years.  Set aside Dell for a few months and the update of the iMac to El Capitan OS 10.11.3.  Recently tried old setup with same Dell PC and was able to move from Mac to PC, but the PC screen resolution was at the lowest setting. I got an error message when enabling/disabling to PC who said there was a problem with the port causing mini display of the system back to the lowest resolution. Impossible to reset at a higher resolution.

    I tested the Dell PC on another monitor, and it works very well at higher resolution (2560 X 1440). Now, when I reconnected it to the iMac (which works fine), the screen becomes black.

    Is it possible that the operating system upgraded (El Capitan) is not compatible with the targets using mini display port Display Mode?  Any ideas?

    Use your iMac as a display with the target - Apple Support Display Mode , also consider having a bad cable or connection. Does not hurt to try different cables, they can and will the bad!

  • problem with the Finder - files and folders displaying incorrectly

    After acquiring a new iMac, I noticed a problem with the Finder - files and folders are displayed wrong (see table).

    This is what happens always after the files have been transferred from one folder to another. I was reminded of my days of using Mac OS in the 1980s when automatic setting of files was not so "automatic." I use Mac OS for decades and I don't remember the last time I had to think about GUI problems like that.

    Other problems in the graphical display of files and folders were introduced, such as when you have hundreds of files in a single folder, you end up deleting about 30 to 40 of them say in a particular section, and you end up with gaps of the ChartSpace where files used to be, that is the remaining files automatically rearrange themselves (fill in these gaps) - never. A week later, you open the folder, and the gap of GUI is still there.

    I decided to do a clean install of the operating system but nothing works.

    Is there some setting in Prefs I'm missing?

    Hi there highland99,

    Looks like your folder icons are not accommodating themselves automatically you plan to do. To me, this indicates that you have organize by the None value in the view menu. You can change the way files and folders are prepared automatically by clicking on view > reorganize by and selecting how you would like that fixed.

    Thank you for using communities of Apple Support.

  • I am facing a problem with the beep.vi. I have a DAQ program, which acquired the signal and compare it to a threshold value. When a signal is out of range, a Visual and sound alarm has occurred. I use the VI beep.vi to generate the sound.

    I am facing a problem with the beep.vi.  I have a DAQ program, which acquired the signal and compare it to a threshold value. When a signal is out of range, a Visual and sound alarm has occurred. I use the VI beep.vi to generate the sound. Everything works fine except the sound alarm. It gives the table 1 d of type mismatch. I tried to fix this by placing it in a box structure. But it still does not work. If someone could help? Please find attached my VI. Best wishes to all visitors to the Forums of Discussion OR.

    Ihab El-Sayed

    published here: http://forums.ni.com/t5/LabVIEW/Playing-sound-based-on-exceeding-a-threshold-value-1D-array-data/m-p...

  • Problems with the display of the 3D graph

    Hello world

    I use a 3-d chart in one of my screws and I have problems with the display. See what it shows by yourself:

    So, as you can see, the chart does not correctly display the data. But one thing I know, is that the data are sent correctly, because when I copy the LabVIEW graphic and paste it into paint, what I see, this is the graph displayed correctly:

    Anyone know what may cause the problem? I also have a similar problem with a waterfall in 3D.

    You can always download the updates of ni.com so.

    I also went through a documentation on known LV 2011 issues. I was able to find something interesting onthis page:

    3D image controls can display transparently or LabVIEW crash on some graphics cards

    The 3D Picture Control is based on an OpenSceneGraph that uses OpenGL. It was noted several reports of the 3D image control crashing LabVIEW. In almost all cases, it was an Intel graphics integrated into question. This accident is due to a mismatch of the graphic material. Note: most 3-d charts use the 3D picture control

    Some possible workarounds are:

    • Update the video driver
    • Enable/disable hardware acceleration
    • Enable Aero in Windows 7
    • Disable Aero in Windows 7

    I might try these workaround solutions and see if any of them work for you.

  • After submitting my info, I had the SERVER ERROR: 500 internal server error! There is a problem with the resource you are looking for, and it cannot be displayed. :

    Over the four days, I've lost two e-mail accounts:

    1 * e-mail address is removed from the privacy *

    2nd * e-mail address is removed from the privacy *

    I went to www.windowslivehelp.com

    I filled in all the information and answered all the question. I provided

    the email address where I can be reached: * address email is removed from the privacy *

    But when I click on submit

    "The display shows:" Server error

    500 internal Server Error. There is a problem with the resource you

    can are looking for, and it cannot be displayed' you explain or tell me

    How can I return my email accounts. Thank you and best regards

    B.Okediji sanogo

    {deleted}

    E-mail address is removed from the privacy *.

    Hi Zacheus B.Okediji,

    1. what web browser do you use?

    2. when the problem started?

    The website you are visiting had a server problem preventing the display of the Web page. It often occurs due to maintenance of the site, or due to a programming error on interactive websites that use scripts.

    For more information, see the following article:

    Get help with the Web site (HTTP error) error messages.

    If you use Internet Explorer, you can read the following article and try steps 2, 3 and 4 to solve the problem.

    Internet Explorer is slow? 5 things to try

    Note: Resetting the Internet Explorer settings is not reversible. After a reset, all previous settings are lost and cannot be recovered.

    You can also visit the following links to support Windows Live:

    "Server too busy", "Internal Server Error" and we do little maintenance to improve the service.

    Internal server error when trying to open hotmail

    Hope this information is useful.

  • Trying to solve a problem with the list under display properties screensaver!

    When I try to put my screensaver, gout dwon displays a completely blank entry followed by (None) & the list of available screensavers.  Every time I choose (none), it is up to the last installed screen saver.

    An example: the last installed screen saver was ArcSoft Photobook screensaver.
    So, when I select (none) for no screensaver, it is up to the ArcSoft Photobook screensaver.

    This happens each & everytime I have add a new screen saver.
    (None) option always returns to the last screen saver installed.

    There are moments that I need the option screensaver set to (none).

    Any ideas on how to fix this problem would be greatly appreciated.

    Ed

    Not sure as to what I did, however, my problem with the screen saver has been fixed.

    I've been messing around with a number of things that I thought might have caused this problem.  And wala, suddenly the problem existed no more!

  • Blue screen on startup... problem with the display driver?

    I have been using a Dell Inspiron 14R (N4110) laptop computer since 2010 without any problem.

    The laptop was purchased online from Dell and came with

    (1) Windows 7 Home Premium 64-bit and

    2) AMD Radeon HD 6470 M - 1 GB display card.

    Recently, I had a problem where my laptop just wouldn't start, showing the blue screen every time it tries to start. The blue screen mentions a problem with the file atikmpag.sys I understand is the driver for the AMD video card.

    If I delete/rename the files atikmpag.sys and atikmdag.sys (via secure boot mode) in C:/windows/system32/drivers, the laptop (not) start, but obviously does not recognize the graphics card.

    After a lot of unsuccessful trials debugging on mine (including trying to upgrade the drivers to display etc.)., I reinstalled the operating system and the drivers provided with the original kit (just to eliminate any possibility of an upgrade that went wrong). However, I still see the issue.

    That means there is a hardware problem? or a BIOS problem?

    Thank you

    R.B.

    Guys, the problem you describe is actually a hardware failure. There is nothing you can do except replace a motherboard for laptop, or taken some advanced technicians, COMPUTING which will replace or chip GPU reball.

    I have the same a laptop similar (Inspiron N5110), with the same problems and these problems - all started yesterday. Do not waste your time, just reinstall OS, then install display drivers, which are available on the official site of Support of DELL and after that - if it's not working, just do what I said.

    Generally these are consequences of an overheating laptop, but that it was certainly not my case (I did regular checks), I could even bet on chips quality GPU, which has been used in the manufacture of this model of laptop... again...

    UPDATE: Okay, last night was a long night for me and I can confirm finally - who's * chip AMD, which causes the blue screen, you mentioned. I disassembled my N5110 faulty, armed with a heatgun, Probe temperature (probe) and tons of aluminium + some flow of brazing, I made a fairly quick reflow and the result is just what I expected - everything works perfectly again, with the same configuration - even with the same installation of Windows, which has been to launch these blue screens. There are now no blue screen at all and portable computer performance as new.

    Apparently bad welding, when this laptop was manufactured, is the exact reason why we are where we are. The BGA chip was not dead at all (it was just poorly soldered). The same story, including HP and a bunch of other companies had some time ago with these NVIDIA chips (I know, some of you know what I'm talking about).

    CONCLUSION: Integrated DELL diagnostic software is useless against the detection of defects with a discreet graphics AMD card. Problem was not in the software or drivers - it was just a poorly welded chip (I regularly cleaned my laptop dust, so overheating is not an option here).

  • "A problem with the display driver.

    Recently, I get an error message whenever I open Photoshop CS4. It reads as follows.

    "As Photoshop has encountered a problem with the display driver and has temporarily disabled GPU enhancements. Visit the Web site of the manufacturer of the video card for the latest version of the software.

    "GPU improvements can be enabled in the Performance preferences panel."

    I checked the graphics cards in Device Manager, and when I tried to update the software, it told me that I was aware.

    • OS: Vista Edition Home Premium
    • Dell Inspiron 1520
    • Display driver: NVIDIA GeForce 8400 M GS

    Sincerely, Danny

    Hello

    Try to update your display manually driver and do not use the analysis of the drivers on the manufacturer's website either.

    This is my generic how updates of appropriate driver:

    This utility, it is easy see which versions are loaded:

    -Free - DriverView utility displays the list of all device drivers currently loaded on your system. For
    each driver in the list, additional useful information is displayed: load address of the driver, description,.
    version, product name, company that created the driver and more.
    http://www.NirSoft.NET/utils/DriverView.html

    For drivers, visit manufacturer of emergency system and of the manufacturer of the device that are the most common.
    Control Panel - Device Manager - Display Adapter - note the brand and complete model of your
    video card - double - tab of the driver - write version information. Now click on UPdate Driver (this
    cannot do anything as MS is far behind the certification of drivers) - then do a right click - Uninstall - REBOOT
    This will refresh the driver stack.

    Repeat this for network - card (NIC), Wifi network, sound, mouse, and keyboard if 3rd party with their
    own the software and drivers and all other main drivers that you have.

    Now go to the site of the manufacturer of system (Dell, HP, Toshiba as examples) (restoration) and then of the manufacturer of the device
    (Realtek, Intel, Nvidia, ATI, for example) and get their latest versions. (Look for the BIOS, Chipset and software)
    updates on the site of the manufacturer of the system here.)

    Download - SAVE - go to where you put them - right click - RUN AD ADMIN - REBOOT after each installation.

    Always check in the Device Manager - tab drivers version you install actually shows up. This
    because some restore drivers before the most recent is installed (particularly that audio drivers) so install a
    pilot - reboot - check that it is installed and repeat if necessary.

    Repeat to the manufacturers - BTW on device at the DO NOT RUN THEIR SCANNER - manually check by model.

    Look at the sites of the manufacturer for drivers - and the manufacturer of the device manually.
    http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htm

    How to install a device driver in Vista Device Manager
    http://www.Vistax64.com/tutorials/193584-Device-Manager-install-driver.html

    If you update the drivers manually, then it's a good idea to disable the facilities of driver in the Windows updates,
    This leaves ONE of Windows updates, but it will not install the drivers who are generally older and cause
    questions. If updates offers a new driver and then hide it (right click on it) and then go look for new ones
    manually if you wish.

    How to disable automatic driver Installation in Windows Vista - drivers
    http://www.AddictiveTips.com/Windows-Tips/how-to-disable-automatic-driver-installation-in-Windows-Vista/
    http://TechNet.Microsoft.com/en-us/library/cc730606 (WS.10) .aspx

    Hope these helps.

    Rob - bicycle - Mark Twain said it is good.

Maybe you are looking for

  • Satellite L500 - FN toolbar disappeared

    I updated to Windows 7 and since then, the "easy tool bar" enabled by FN disappeared.do I need a driver?Thank you

  • A369i displaying not a name for incoming calls

    I bought an A369i a few months ago. It worked all fine, but now, ILA does not display contact names, number only. I tried to save format + 91 contact no.s and not starting with 0, but don't work. I also deleted all the data of the phone app, but even

  • problem installing drivers on my HP Photosmart Premium C310a

    For some reason, out of the blue my printer has stopped printing from the computer.  After having gone through the troubleshooting of HP and told to download the updated drivers to update, I downloaded and tried to install the drivers for my printer

  • Lower the resolution of the screen

    Hello! Got a game for my children and I need to lower the resolution to 640 x 480. My slider in display settings only goes down to 800 x 600. Is their a way around it. Game will let me play otherwise. Thank you

  • BlackBerry smartphones how browser problem fixed?

    my blackberry "BOLD" 9780 used can open Web site, for example. www.Facebook.com www.youtube.com, but now he cannot not the browser can only open wap or mobile site, please help, what do thnx;