Using an array to define text fields

I am developing a fairly simple program that will calculate the relationship of say a basketball player's height to his number of rebounds. It will display residual output, a graph, and many other things related to statistics. However, I have run into a problem.
I want the user, at the very first screen, to use my combo box to define the number of pairs of data points he has in his relationship. So if he clicked on 10, the next screen would display 20 text fields, an X and a Y for each data point. My problem is I cannot create a user-defined amount of text fields in a for loop. If I use an array, string[count], to use as the name, it will not let me.
Any suggestions or do I need to elaborate more?

This would be the code for where I try to create the JTextFields.
for(int count = 0; count<(2*getValue()); ++count)
private JTextField values[count] = new JTextField(6);The array values[] simply contains values from 1-60. It will not allow me to use an array to name the JTextField.
Also, I am not familiar with the List class. It sounds interesting, and it may be what I need.
Sorry if that is not exactly the right code; I am not at my personal computer at the moment.
Message was edited by:
greenspacechunks

Similar Messages

  • How can I set the caption text of picture controls inside an array or how can I choose which array element is assigned using the array elements caption text property.

    I have 8 picture controls inside an array and I would like to set the caption text of these controls.
    I have used the property node of the array and used the array elements property caption text to set the text.
    The problem is however that I set the same text to all the picture controls inside the array.
    My question is how to set caption text of specific elements (Picture control) that I have so far only been able to access using the array elements caption text property.

    Some more help
    1 You could use the caption of the array and place it in front of the selected picture and update that using property nodes.
    2 Like Norbett said if you use a cluster of pictures then their caption can be updated individually.
    Here is a an example that demonstrates the above
    David
    Attachments:
    Modify the Captions Of Pictures.vi ‏83 KB

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • Set a Limit in Using a Comb in a Text Field

    I have a Text Field that has a Comb of 6 characters. The uses should input either a 5 or 6 characters in this field. Is there a way to give an error message if the user does not input at least 5 characters?
    Thanks for you assistance,
    Parre

    Try this code in the Exit event of the field with JavaScript as the language..
    if(TextField1.rawValue.length<5){
    xfa.host.messageBox("The field length should be minimum 5 characters");
    xfa.host.setFocus(this);
    Thanks
    Srini

  • Using plugin to display a text field

    How can I use plugin to display textfield?              

    It's a bit more complicated than you probably would expect: You need to
    load the AcroForm HFT and then execute the JavaScript to create your text
    field via the the AFExecuteThisScript() function.
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    [email protected]
    http://www.khkonsulting.com

  • Do I need to use javascript to get a text field in a PDF form to aut fill with current/today's date?

    I have a form for booking appointments and would like the date field to automatically fill with
    today's date and to print. I have set the text field's format to "Date" and when I place the cursor into the
    date field, today's date shows. It disappears as soon as I tab to the next field.
    Does this action require a javascript script to fill and print today's date? If so, where do I find that?
    Or is there another way to format the text field (besides typing today's date) to get the current date?
    Thanks.
    Ali
    using iMac 2.93 GHz Intel Core 2 Duo 8 GB | OS Snow Leopard 10.6.8 | Acrobat Pro 8

    Thank you GKaiseril!
    From the examples by Chris Dahl, I edited the script in the text field editing dialog to reflect the title I had given the field. That fixed the problem of today's date disappearing as soon as I tabbed to the next field.
    How do I choose for document level or page open script? I would like it to insert the date upon opening the document.
    Thanks again.
    Ali
    NOTE: I found the answer within Chris Dahl's tutorial... path is for Acrobat Pro 8: Advanced>Document Processing>Document Javascripts

  • Using Javascript to change multiple text field names

    I have a pdf with multiple text fields. I need to change all the text field names (General -> Name) so that they are unique so that when I combine multiple pdfs together, the text fields will stay intact. Is there anyway to do this using javascript? Thanks!

    I'm new to javascript too...it will be very helpfull for me too...Thanks
    poltrone
    prodotti chimici

  • Report error when using combo box and one text field is empty

    I'm building an interactive pdf in adobe pro 9. My problem is the following: I have one text field where you can enter a numeric code and that is used to populate another text field when I choose an option on one combo box.For example: suppose I write the code 123 in the text field "A" and that the combo box has two options ("data" and "-"). When I select "-", another text field "B" is empty, while when I select "data" i populate the text field "B" using the code entered "A" with the text "data_123". In order to do this I use the standard javascript code in the Format>Custom tab of the combo-box.
    My questions are:
    - how can I prevent the pdf to proceed selecting an option in the combo box when the field "A" is empty?
    - how can I update the field "B" every time that I change the text in "A"? I found that the text is "B" is updated only when I press the selection in the combo box.

    You can set the combo box to read-only in the Validate event of the A field:
    // Validate script for text field
    getField("combo1").readonly = !event.value;
    To update the value of B when A changes, you can expand the script above to something like:
    // Validate script for text field
    var f1 = getField("combo1");
    var f2 = getField("B");
    // If there is an entry in the A field...
    if (event.value) {
        f1.readonly = false;  // Make sure the combo box is activated
        f2.value = f1.value === "-" ? "" : "fa.value + event.value;  // Update the value of field B
    } else {
        f1.readonly = true;  // Deactivate the combo box
        f2.value = f2.defaultValue;  // Reset field B
    You might also want to reset the combo box somewhere in there, but it's not clear to me when you would want to do that.

  • Guideline for Using 40 Char in Short Text Field of Material Master

    Dear Experts & Forum Members,
    In MM01 while creating a Material Master record (spare part) we need to fill in Basic Data. It has a field known as "Short Text Field " This Field has limitation of 40 characters. This is the same field which has Searched associated with it. This description is what we see when we look for Stock Overview of Material in the Stores through MEMBER.
    To use this 40 characters efficiently people usually come up with a guideline so that maximum and meaningful information crucial information for identification of spare part/material is VIEWED when we see it.
    For example for an AC Motor the description may look like
    *MOTOR AC SQ 100KW 1500 RPM 8P CLA FRXYZ
    which describes AC Motor, Squirrel Cage Type, 100 KW, 1500 RPM, 8 Pole, Class A, Frame Size XYZ
    Request the forum members to provide / share any guideline they might have come up with to use these 40 characters to describe different spare parts.
    Thanks in advance for your help.
    Regards
    Vinay
    Edited by: VINAY MAITHANI on Jul 15, 2010 6:51 PM

    Hi Vinay,
    We are also doing the same activity and we are arranging the material description in a manner which is almost simlar to you.
    But, except one thing which is Classification. We have classification feature mapped with material master for the details of Dimension,Brand,Color and Orgin.
    For further commets, rever back.
    Regards,
    NAK
    Edited by: abdul kader on Jul 28, 2010 9:36 AM
    Edited by: abdul kader on Jul 28, 2010 9:38 AM

  • How to change the font used to fill in a text field.

    Can you please tell me how to change the font that comes up when a text field is filled in?
    Can I change this setting in InDesign or does it have to be done in Acrobat?

    It must be done in Acrobat. InDesign only allows Times Roman for some reason.
    To change it in Acrobat 11, open the PDF and select: Tools > Forms > Edit
    and select the field(s) you want to change, bring up the field properties dialog, and look on the Appearance tab for the font dropdown.

  • How to change the font used to fill in a text field in an interactive form.

    Can you please tell me how I can change the font that comes up when you go to fill in a text field in an interactive PDF?
    Can this be set in InDesign or does it have to be done in Acrobat?

    Only in Acrobat. Tools > Forms > Edit. Double-click on the text field to change its Appearance.

  • Using radio button instead of text field

    Hi. I need to convert a text field for radio button. The conversion is as follows: the user will choose one of three options on the radio button (gif, png and jpeg). If the user chooses the image format such as jpeg, for example, how should I put in value? Put image/jpeg and does not work. This text field belongs to a form that was generated automatically by a WebService Data Control. Thanks

    remove the text field.
    drag and drop that attribute from data control, choose selectOneRadio
    in the wizard window, select fixed list and select this particular attribute and then type gif, png and jpeg one by one.
    in the pagedef it would be something like below:
        <list IterBinding="myIterator0" id="image" DTSupportsMRU="false"
              StaticList="true">
          <AttrNames>
            <Item Value="image"/>
          </AttrNames>
          <ValueList>
            <Item Value="gif"/>
            <Item Value="png"/>
            <Item Value="jpeg"/>
          </ValueList>
        </list>whatever you select that values goes to db.

  • Use addChild to create a text field but cannot get its height

    Hi,
    I am using addChild to dynamically creat text components
    Text() . But I when I access its height property, it is always 0
    even though the text is wrapped around. Has any one seen similar
    things and have a solution?
    Thanks!

    If I call the method that check the height of the newly
    created text objects in a button (i.e., click=""), it works. So it
    maybe a timing issue: should wait for the creation of the children
    to be all done?
    So, how do I add a even handler to check the finish of each
    addition the text object?
    Thanks!

  • Splitting of text fields when using multiple fonts within a text field and exporting it to XFL.

    Hi All,
    I have been trying out  InDesign and exported files to XFL for use in Flash. If I use a single font for a text box then everything looks fine in flash, but if  I use multiple fonts for the same text box its split into multiple text boxes. For making this more clear I have attached an image.
    Any help to resolve this!!!

    Paragraph styles are tied to the paragraph, not the page.
    You don't say which version you are using, but here's something you could try in CS3 or CS4. Set up a baseline grid in the preferences to match the main pages. The spacing should match the leading of the body text. Make a special paragraph style (you can base it on the body text style) that you will apply to text onthe chapter start page, and as part of that style set it to align to baseline grid. Now for the trick. Select the  text frame onthe start page and define a custom baseline grid with the spacing you want. Save it as an object style, too, while you're at it. The strating text should align to the custom grid on the start page and the documetn grid on the next page.
    Peter

  • How to Populate a drop down list using the values of a text field?

    Hi,
    I wanted to Populate the items of my drop down list according to the value entered in the textfield above it?
    also the value of list remains consistent in other rows also where i am using the drop down list field.
    Please Try to help me in this query.
    Thanks in Advance!!!
    I am using Javascript in adobe version ES 8.2.

    Part II:
    If you have other items for your droplist(s) that are to appear in addition to the "variable language" entered by a user you can add that to the script.  For example in addition to the Party1 and Party2 name appearing in my droplist I also want the list to have an option for a user to select: The parties jointly.  I add this to the script:
    this.addItem(Party1.rawValue);
    this.addItem(Party2.rawValue);
    this.addItem ("The parties jointly");
    If you have trouble making it work, post a bit of your actual form requirements.

Maybe you are looking for

  • Screen Issues: Strip of extra brightness? Corners brighter than others?

    I got my iMac back in August (just before the 24" came out, I'm kicking myself in the butt for it) and back then I noticed that the top-right corner and bottom-left corner were slightly brighter than the other two corners, but didn't think much of it

  • Error in ALV for ISO Codes

    Hi, I displaying an ALV with all ISO code.But im getting an error BM(302). (nternal unit &, language & is not maintained) The internal table is having all values,but on ALV displaying ***. Please help solve this issue

  • Pixel size for web

    So i downloaded a flash temp for my bands website. It is my first attempt at flash. The background pixel size is 766x750. I worked off this and am finished the site. Now however when i upload my site it doesn't fill the screen.It's more of a square!

  • Rich Text Editor 100% CPU in Chrome w/ Player 10.1

    On IE, FireFox, and Safari, all running WIN 10,0,45,2 moving the mouse around in an RTE results in about 10% CPU utilization. However... with the following Player Version: WIN 10,1,53,22 Google Chrome 5.0.375.29 beta Windows XP CPU jumps to 100% whil

  • Handling Connection Reset

    I have a app server box and a DB box . The code calls a stored proc on the DB. In between the execution of the procedure the connection between DB box and App server box is broken. What will be the state of the execution of procedure. I mean what wil