TextField inside the dialog box?

I saw on games like brickbreaker. They have a dialog box to come and ask you to enter your user name. I tried a little differently, but I have not had luck with it yet. Can someone point me to a tutorial or just after a line or two of code on how to do it?

Thank you

In your TestDialog class, add this method:

    public final class TestDialog extends Dialog{

        private EditField userNameField;

        public TestDialog(String choices[], int values[]){
            super("Enter a username", choices, values, Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.INFORMATION), Dialog.GLOBAL_STATUS);
            userNameField = new EditField("User Name: ", "", 50, EditField.EDITABLE);
            net.rim.device.api.ui.Manager delegate = getDelegate();
            if( delegate instanceof DialogFieldManager){
                DialogFieldManager dfm = (DialogFieldManager)delegate;
                net.rim.device.api.ui.Manager manager = dfm.getCustomManager();
                if( manager != null ){
                    manager.insert(userNameField, 0);
                }
            }
        }    

        public String getUsernameFromField(){
          return userNameField.getText();
        }

    }

Then change your main class to use:

        if(pw.doModal() == Dialog.OK){
            System.out.println(pw.getUsernameFromField());
        }

Tags: BlackBerry Developers

Similar Questions

  • Why can't I get a glimpse of the indd files in the dialog box to open InDesign?

    Hi all

    It is unfortunate that Adobe does not add a plugin to display a preview of any Adobe source file in Windows Explorer (I mean, except for the PDF but I think that Microsoft did this).

    But I think it's ridiculous that I can't preview the source .indd inside the dialog box to open InDesign files. He says just, "no preview available". I am sure that this failure is related to what Windows can preview... again, not a good excuse!

    It is also the same problem in Illustrator and Photoshop... or program Adobe can get a glimpse of their own file format!

    WHY?  OR how can I fix this?

    [UPDATE: SageThumbs |] [SourceForge.net seems to partially work on several Photoshop files (works reasonably well as long as I limit the file size to 70 mb), it doesn't seem to work with Illustrator files (despite the claim), and it does not work on InDesign.]

    Yet the question remains: why Adobe is not taking responsibility for this?

    I think that for the dialog open regularly, Adobe wants to use operation

    Open the file integrated system of dialogue, so that users are familiar with it.

    and also if they can use the peculiarities of their OS (Windows vs

    Mac have different habits).

    And to solve your problem, they created Bridge (and even Mini Bridge).

    He could theoretically get into the habit to use to open the files,

    That is, instead of file > open it just click on the bridge icon.

  • How the acreage inside the dialog not outdoors

    Harvest of Acrobat tool, V.9, how can I say crop tool for

    delete the content inside the dialog box not outside?... .thank you... Alfie

    The redaction tools has many options, you can remove the text or image, you can delete the text or image and replace it with the text, or you can delete the text or image and the cover with a colored bar. The choice of what you are doing is yours.

  • Complete TextField in a dialog box

    I am trying to create a dialog box that will allow me to change the address of my place or simply confirm the address that appears in the dialog box by clicking ok.

    Then take a look at the documentation for class of dialogue - in particular the add methods and doModal . You add a variation of a TextField, of course. Create a public method in your CustomDialog that retrieves the text of this TextField and returns to the caller and the call once the dialog box is dismissed (doModal returns).

  • Script multi coding insert in the dialog box

    Dear friends,

    I was trying to script for "Multi script coding to add to the unique script". I need to use the dialog box. Since then I made dialog box encoding (see my code below).

    But I did not now how to add multi script coding in the dialog box on the inside?

    My requirement: I want to select a box of a script. I need to run that select only script code. Otherwise, another script code required to run no..

    Example:

    1. I chose 1 '01_Overrodes' script, I just run this script only.
    2. I chose 2 script "02_FindText", just I want to run this script only.
    3. I chose 3 script "replace 03_Alert_Basic" I want to just run this script only.

    Screen Shot 2016-04-28 at 3.40.40 PM.png

    var  
      w=new Window("dialog", "Action List"),  
      radio=w.add("panel", undefined, "Choose Action"),  
      option1=radio.add("radiobutton", undefined, "01_Overrodes"),  
      option2=radio.add("radiobutton", undefined, "02_FindText"),  
      option3=radio.add("radiobutton", undefined, "03_Alert_Basic Replace"),  
      option4=radio.add("radiobutton", undefined, "04_Tracking, Kerning and Nonbreak");    
      option5=radio.add("radiobutton", undefined, "05_Colour Remove");    
      option6=radio.add("radiobutton", undefined, "06_Foilo order");    
      
      w.add ("button", undefined, "OK") 
      option1.value = true;    
        radio.alignChildren="left";    
        radio.margins = [10,10,50,10];  
      
      
    
    
    //where is i add my coding
    
      
      
    if (w.show() == 1){      
         if (option1.value) alert("Action One!");  
         if (option2.value) alert("Action Two!");  
      if (option3.value) alert("Action Three!");  
      if (option4.value) alert("Action Four!");
      if (option5.value) alert("Action Four!");
      if (option6.value) alert("Action Four!");
        }    
    else {      
        exit();      
        };  
    
    
    
    var  
    

    Please help and suggest me friends.

    Thanks in advance

    Hello Kitty,

    You can use it like that too,

    var

    w = new window ('dialogue', "Action List"),

    Radio is w.Add ('Committee', undefined, "choose the Action").

    option1 = radio. Add ('radiobutton', undefined, "01_Overrodes"),

    option2 = radio. Add ('radiobutton', undefined, "02_FindText"),

    Option3 = radio. Add ('radiobutton', undefined, "replace 03_Alert_Basic"),

    option4 = radio. Add ('radiobutton', undefined, ' 04_Tracking, kerning and Nonbreak");

    Option5 = radio. Add ('radiobutton', undefined, "remove 05_Colour");

    option6 = radio. Add ('radiobutton', undefined, "order 06_Foilo");

    w.Add ("button", undefined, 'OK')

    option1. Value = true;

    radio.alignChildren = "left";

    radio. Margins = [10,10,50,10];

    If (w.show () == 1) {}

    If (option1.value) {((Folder.desktop+"/0/01_Overrodes.jsx") leader, ScriptLanguage.ja vascript) app.doScript};

    If (option2.value) {((Folder.desktop+"/0/02_FindText.jsx") leader, ScriptLanguage.jav ascript) app.doScript};

    If (option3.value) {app.doScript (File (Folder.desktop+"/0/03_Alert_Basic Format.jsx"), ScriptLanguage.javascript)};

    If (option4.value) {app.doScript (leader (Folder.desktop + ' "/ 0/04_Tracking, kerning, and Nonbreak.jsx" '), ScriptLanguage.javascript)};

    If (option5.value) {app.doScript (File (Folder.desktop+"/0/05_Colour Remove.jsx"), ScriptLanguage.javascript)};

    If (option6.value) {app.doScript (leader (Folder.desktop+"/0/06_Foilo order.jsx)", ScriptLanguage.javascript)};

    }

    else {}

    Exit();

    };

  • reason for commas not allowed in the dialog box select text resource

    Hello
    I use jdev 11.1.2.2 and I was quite surprised by not being able to put the comma in the key in the dialog box select text resource. This behavior forces me to change the resource group by hand and not through this dialog box.
    Is there a reason for this undocumented? Because in my teams, nobody thinks that something like:
    mainTable.header=header Text
    secondTable.header=different Text
    is worse than the variant with underscore...

    If I interpret things the way that I think you mean, for example in the dialog select a text key resource cannot be a string without a period (or comma never seen that myself) as a separator, then the explanation is simple.
    This function of "convenience" of a resource string mapping depends on the access of the implicit getter of the Expression language.
    for example, the created EL is in the form #{viewcontrollerBundle.key}, which corresponds to the bundle.get ('key'); in terms of java.
    To support the use of the period (or the comma!) inside the key, the generated form will have to implement: #{viewcontrollerBundle ['key']} otherwise an example like this:
    #{viewcontrollerBundle.mainTable.header} would be generated which, in words EL would be mapped (as a Variant) with bundle.getMainTable () .getHeader () because of the way periods are interpreted in EL.
    So basically, the dialog box is properly in the light of the real EL that is generated.
    All this side - it is a known restriction and 12, we changed the EL format to the more flexible form in this case and therefore the dialog box will accept periods.

  • Unable to select the file in the dialog box in the Sierra

    I'm unable to select an image file in the "save for Web" in the finder window "save under" in Photoshop CC running on the Sierra.

    There are times where I need to save a new image using a similar name by selecting the existing file, which matches the name in the dialog box "save under".

    The use of Photoshop CC in Sierra I am unable to do so due to the inability to select the existing files in the Save-as the finder window.

    I thought at first that was Adobe, but later, I noticed that I can not save for web browsers and other programs. I installed the beta updates on Sierra, but also which did not set. I hope be fixed so I can move on to Sierra. It was not such a problem in previous versions.

    Unfortunately, your discovery is correct. I just met for the first time. I was shocked, but apparently it will work in list view. View miniature not a reason any.

  • The dialog box to create a submap appears, but the submap is not installed

    Hello
    I select a map in the e-mail section and in the file menu that I choose to create a submap.
    The dialog box is displayed, I learn the name of the submap, then click to create, the dialog box closes but any submap is created.

    Thanks in advance for a quick response.

    Roman.

    If you are using an IMAP e-mail account, and you create a subfolder, you will have to 'register' to actually see this folder.

    Try this:
    Right-click on the name of the e-mail account, and then select 'subscribe '.
    You should see a list of folders and subfolders.
    Select the subfolder, and then click OK.

  • How can I replace the mime types of server, always get the mp3, rar, sid, bin files directly in the dialog box "where do you want to save this file?"

    I used to be able to click on MP3 files, the way back when, and Firefox asks where I wanted to save. Nowadays, it opens a new tab with a flash drive.
    By clicking on the "unknown" files, like .sid, .prg, .zip, .rar is ' this is a BIN file. [Cancel] [Save] ». It does not give me a check box for "always do this".
    I would like that option to edit so that certain types of files, such as PDF, regardless of mimetype, always get opened in a new tab if you click. Also some types of files, based on the extension, always go directly to the dialog box "Where you want to save the file?", without worrying if there is a viewer or a builtin player or not. In my Firefox (41.0.1 14.04LTS 32-bit Ubuntu) I have never the choice "do this for these files always" more.
    Googling led me to delete my file mimeTypes.rdf and since file extensions can even "well known", such as .zip, are treated as BIN files and I get the box Cancel-or-Save for those too - again without the choice of "always save the BIN files.

    These files are send as Content-Type: application/octet-stream and Content-Disposition: attachment;
    To send files in this way, you cannot save an automatic action.
    You can see that in network monitor.

    Content-Disposition: attachment; filename="TURRICAN_AMIGA_PORT.sid";
    Content-Type: application/octet-stream
    
  • The mouse pointer jump at the top of the screen when the dialog box opens

    In the last few weeks my mouse pointer jumps sometimes extreme high (left side) of the FF browser window. Only happens in FF, Chrome or IE or any other application from Ms. The mouse to update drivers fees Reloaded, switched mouses, USB switch, ports switched to a mouse not MS - all to nothing does.

    "It seems to happen most often when I mouse ' snap to" feature is turned on and that the pointer automatically moves to the default button in the dialog box.

    This unique disability FF to hide the pointer when you enter (when the value in the mouse properties box) have become very annoying.

    Please address and solve the two problems above. Thank you.

    Good news! Now come on. For the moment, you can disable
    KeyScrambler. You can always turn it on when you need it.

  • How do you download Firefox on a laptop Windows 8? Never RUN the dialog box.

    I have a problem with everything I try to download. After that I click on download, I don't me the dialog box RUN. The computer shows it has downloaded the file, asks if I want to open or save, but does not execute the executable file no matter what I try. I disabled the pop-up blocker, I'm in the administrator account, I don't know what else to try. I searched google for answers and contacted a couple of software support sites, but have not taken place in all of the answer. The last of them suggested that I use Firefox, but I can't download it either.

    I solved my problem by disabling (uncheck) "Enable Protected Mode".
    In Microsoft Explorer / Tools / Internet Options / Security (tab)
    Then restart the Explorer and start your download.
    Once I finally got Firefox downloaded, it worked fine, and I left the using Explorer.

  • I can't upgrade my Macromedia Flash software. The dialog box keeps telling me that I need to close Firefox and Firefox is not open.

    I'm trying to upgrade my software Macromedia Flash and I can't perform the upgrade because the dialog box tells me to close Firefox. I close Firefox and the process keeps telling me that it cannot perform the upgrade until I close Firefox Firefox is closed! Don't know what I can do.

    If you have already downloaded Flash Installer, restart your computer, and then try to run the installer of Flash. then try launching firefox and upgrade to Firefox 11. Does it work? Usually problems like this are caused by a bad extension, so if it works, we can diagnose your extensions.

  • Impossible to close or to access the dialog box

    within a Web site "forms", the dialog box is open, but I don't see the buttons "ok/Cancel". nothing happens when I click on the button (cancel or ok) and I cannot close firefox. use "quite the force" to solve the

    Hi imlostinspace.
    Looks like you may need to add a cookie for this site. This article describes how to do this:

    Solve connection problems on Web sites that require a user name and password

    Hope that helps.

  • Pages is not track changes inside the text boxes?

    I try to use Pages, industry changes, but it seems to be limited to body text. If I include images deleted, or if I change the text inside the text boxes, no changes are followed. What is a limit? (Version 5.6.1 of pages)

    See this thread for an answer from VikingOSX, the short answer for the current Version is no.

    Pages ' 09 fact.

    Track changes in text boxes

    You could always suggest via Contact us Apple to add this feature in the news

    http://www.Apple.com/feedback/pages.html

  • Issue of change event in the dialog box.

    Hi all

    I'm having a problem with a user dialog box. The dialog box should use eventchange to update aspects of the dialog box based on a user selection in a drop-down list box. The problem I encounter is that eventchange does not recognize the change of no selection to the first selection. IE, a user will have to select something else first, then change to what they want to be recognized. Is there something better that would solve this problem? or is the problem something else entirely?

    Thank you

    Artemis

    Hey, Artemis,

    The simplest solution would be to use the event EventInitialize to set the combo box to a default value when the dialog box opens, and your settings dialog box to match the selection.  In this way the first change makes the user would trigger change of value.

Maybe you are looking for