Problem with JButtons Text field not updating

Im working on a program (which has its full code included below incase its part of the problem) which wants to change a Jbutton's name during a program. The way I'm trying to make it change is by having a string, "test", be called "before update". then have the jbuttons text equal test. then, in an actionlistener, it changes string test to equal "after update". This doesn't update the Jbuttons text.
I don't get any errors when I press the button, but the buttons name is not updating. Whats causing the buttons name not to be updated?
Thanks for help in advance.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*; 
public class TicTac extends JFrame {
public int Teamplaying = 0;
public int CrossA, CrossB, CrossC, CrossD, CrossF, CrossG, CrossH, CrossI, CircleA, CircleB, CircleC, CircleD, CircleE, CircleF, CircleG, CircleH, CirclI, TLB, TMB, TRB, MLB, MMB, MRB, LLB, LMB, LRB = 0;
String test = "Before Update";
    public TicTac() {
         JPanel TicTac = new JPanel();
         TicTac.setLayout(new GridLayout(3,4));
              TicTac.add(new JButton(test));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              TicTac.add(new JLabel("a"));
              setContentPane(TicTac);
         pack();
         setTitle("Add Numbers Together TicTac");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setLocationRelativeTo(null);
    class TopLeftBox implements ActionListener {
         public void actionPerformed(ActionEvent e) {
         String test = "After update";
         if (Teamplaying == 0) {
              CrossA = CrossA + 1;
              CrossD = CrossD + 1;
              CrossG = CrossG + 1;
         else {
              CircleA = CircleA + 1;
              CircleB = CircleB + 1;
     public static void main(String[]args) {
    TicTac Toe = new TicTac();
    Toe.setVisible(true);
}

1) Strings are immutable meaning you can't change them.
2) Even if you could, the two test strings are completely different variables.
3) To change JButton text, you should call its setText method.
4) For a JButton to perform an action on button press, it needs to have an actionlistener added to it via the addActionListener(...) method.
5) Please read, study, and review the Sun Swing tutorials. You will benefit greatly from having a solid foundation in Swing basics before you try coding in Swing.
Good luck.
Edit: a small example code (SSCCE, if you will):
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Frame extends JFrame
    public Frame()
        JPanel panel = new JPanel();
        JButton button = new JButton("Before Update");
        button.addActionListener(new ButtonListener()); // add actionlistener here
        panel.add(button);
        setContentPane(panel);
        pack();
        setTitle("Frame");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setLocationRelativeTo(null);
    private class ButtonListener implements ActionListener
        public void actionPerformed(ActionEvent e)
            // get the button that called this action
            JButton button = (JButton)e.getSource();
            // update the button's text
            button.setText("After update");
    public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable()
            @Override
            public void run()
                new Frame().setVisible(true);               
}Edited by: Encephalopathic on Apr 28, 2008 9:26 PM

Similar Messages

  • Is anyone having problems with the stock widget not updating?

    Is anyone having problems with the stock widget not updating?

    Widgets unfortunately have gone by the wayside since Apple introduced the App Store a couple years ago.  No widget has received any official recognition in the Apple listing of Widgets since that time.  So it is entirely possible the widget has gotten redirected.   There are many other Apps for stocks.  I personally like the Nasdaq Quote website since it knows mutual funds and other markets as well.

  • Button Setting Variable - Text Field Not Updating

    Hi,
    I am working with Acrobat 9 Pro on Windows.
    I am unable to make the following work: When the user clicks a Button, a Text Field appears with the text associated with the Button clicked. I have tried accomplishing this with a variable declared in the Document JavaScripts, buttons setting the value of the variable, and a Text Field containing a Custom Calculation Script that returns the text associated with the value of the variable.
    Everything works - except the Text Field doesn't return the text associated with the value of the variable. I have an app.alert (for now) in the button scripts so I can see if the variable has the correct value - and it does - but when the Text Field appears - the text never changes.
    What I have observed: if I go back into the Custom Calculation Script of the Text Field and do nothing, go back out, go to Preview, and click on a Button, the text updates to the previous variable value (not the Button variable value I just clicked).
    So - I think - the Custom Calculation Script isn't seeing the new variable "on the fly". Even though the app.alerts are. I don't think this is a Field Calculation Order problem. But maybe it is. And this is where my brain power ends. Any suggestions would be greatly appreciated. Thank you.
    I have this in the Document JavaScripts:
    var ITrig = 1;
    I have three Buttons (want to have more) that will set the ITrig variable.
    Here is what I have in one Button:
    var Inpopup = this.getField("PartASectionIIInstructions")
    ITrig = 2;
    app.alert(ITrig);
    if (Inpopup.display == display.hidden) {
    Inpopup.display = display.visible
    Inpopup.setFocus();
    } else {
    Inpopup.display = display.hidden;
    I have this in the PartASectionIIInstructions Text Field in the Custom Calculation Script:
    if (ITrig == 2) {
    event.value = "#2";
    else if (ITrig == 3) {
    event.value = "#3";
    else if (ITrig == 4) {
    event.value = "#4";

    Thank you. I had tried something like that earlier - without success. That is why I went to the calculation script. So - I went back to the "Acrobat Forms - JavaScript Object Specification" looking for an answer. It finally sunk in I was guilty of this:
    var Inpopup = this.getField("PartASectionIIInstructions").value
    Inpopup = "#3"
    When I should have been doing this:
    var Inpopup = this.getField("PartASectionIIInstructions")
    Inpopup.value = "#3"

  • SPM 5.2 - problem with reason/activity fields - not showing in the report

    Dear experts,
    I have a situation that is hard to describe.
    We have SPM 5.2 - all set and working, now the problem is that for some of the FF sessions the tool is either not reporting the reason/activity fields (due to some technical problem that is occuring randomly) or the users have found a way to abuse the fields and make thier way around them. (these fields are very important for our SOX controls)
    I have created test users to see how they are entering without filling the reason/activity fields, but no luck - i couldnt enter.
    As you know the Activity field is mandatory text field and at least one character must be entered,  but I don`t think this is the workaround, because even if you put space the report still will show it. I have examples where the report is not showing anything.
    The worst is that I can`t simulate such cases.
    Have you ever heard of such nosense?
    Thank you,
    Iliya

    I think I found it - Application deficiency. It is the language that you are logged with. If it is not English the application is not recording the text that you type in the reason/activity fields upon FF session.
    I hope the latest patches are fixing this!
    BR
    Iliya

  • Problem with a text field

    Hi,
    I want to load a string of characters to a text field of a table. I'm using SQL Loader.
    I've tried to declare the field in several types: varchar2(4000), clob, raw, etc, but when I run sql loader to load the text I get the same error: The data file exceeds maximum lenght. I've tried with a shorter text and it works.
    My question is, why I can't load long characters in that field?
    Thanks in advance.
    Regards.

    Although you have made your table column up to size 4000, SQLLoader have not got a clue about that. You still need to tell SQLLoader that the text coming in is more than the default 255 in your control file. Strange isn't it?
    Here is my table named testlog. Note that I changed the column names LOG, DAY, TIME and TYPE because they are reserved Words
    SQL> CREATE TABLE TESTLOG
      2  (LOG_1 CHAR(3) NOT NULL,
      3  DAY_1 DATE,
      4  TIME_1 CHAR(8),
      5  SOURCE VARCHAR2(100),
      6  EVENTID NUMBER(22),
      7  TYPE_1 VARCHAR2(64),
      8  CATEGORY VARCHAR2(64),
      9  USER0 VARCHAR2(64),
    10  COMPUTER VARCHAR2(64),
    11  MESSAGE VARCHAR2(4000) NOT NULL)
    12  /
    Table created.
    SQL> desc testlog
    Name                                                                                                      Null?    Type
    LOG_1                                                                                                     NOT NULL CHAR(3)
    DAY_1                                                                                                              DATE
    TIME_1                                                                                                             CHAR(8)
    SOURCE                                                                                                             VARCHAR2(100)
    EVENTID                                                                                                            NUMBER(22)
    TYPE_1                                                                                                             VARCHAR2(64)
    CATEGORY                                                                                                           VARCHAR2(64)
    USER0                                                                                                              VARCHAR2(64)
    COMPUTER                                                                                                           VARCHAR2(64)
    MESSAGE                                                                                                   NOT NULL VARCHAR2(4000)
    SQL> select * from testlog;
    no rows selected
    SQL>
    I saved the same data you have abvoe in a file named testlog.txt Here is my test controlfile named testlog.ctl
    LOAD DATA
    INFILE 'testlog.txt'
    INTO TABLE testlog
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
       LOG_1     CHAR NULLIF (LOG_1=BLANKS)
    , DAY_1     DATE "DD/MM/YYYY" NULLIF (DAY_1=BLANKS)
    , TIME_1    CHAR NULLIF (TIME_1=BLANKS)
    , SOURCE    CHAR NULLIF (SOURCE=BLANKS)
    , EVENTID   INTEGER EXTERNAL NULLIF (EVENTID=BLANKS)
    , TYPE_1    CHAR NULLIF (TYPE_1=BLANKS)
    , CATEGORY  CHAR NULLIF (CATEGORY=BLANKS)
    , USER0     CHAR NULLIF (USER0=BLANKS)
    , COMPUTER  CHAR NULLIF (COMPUTER=BLANKS)
    , MESSAGE   CHAR(4000) NULLIF (MESSAGE=BLANKS)
    Here is the Result of my test run
    D:\DBMSDIRECT\DBA\Test>sqlldr userid=test control=testlog.ctl
    Password:
    SQL*Loader: Release 11.1.0.6.0 - Production on Fri Nov 5 15:36:05 2010
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Commit point reached - logical record count 1
    D:\DBMSDIRECT\DBA\Test>
    Here is the Result in the table
    SQL> col message format a50
    SQL> col source  format a50
    SQL> col category  format a10
    SQL> col source  format a10
    SQL> col user0  format a10
    SQL> col type_1 format a10
    SQL> col computer format a10
    SQL> set pasge 20
    SQL> select * from testlog;
    LOG DAY_1     TIME_1   SOURCE        EVENTID TYPE_1     CATEGORY   USER0      COMPUTER   MESSAGE
    SEC 04-NOV-10 12:26:02 Microsoft-       4656 Success    12800                 server1.it A handle to an object was requested.^`^`Subject:^`
                           Windows-Se                                             acasa-sa.c  Security ID: S-1-5-21-3830471607-3036766313-42914
                           curity-Aud                                             om         15205-2156^` Account Name: mbelles^` Account Domai
                           iting                                                             n: ITACASA-SA^` Logon ID: 0x38988bbc^`^`Object:^`
                                                                                             Object Server: Security^` Object Type: File^` Obje
                                                                                             ct Name: K:\AMBIENTE^` Handle ID: 0x1e18^`^`Proces
                                                                                             s Information:^` Process ID: 0x4^` Process Name: ^
                                                                                             `^`Access Request Information:^` Transaction ID: {
                                                                                             00000000-0000-0000-0000-000000000000}^` Accesses:
                                                                                             %%4416^` ^` Access Mask: 0x1^` Privileges Used for
                                                                                              Access Check: -^` Restricted SID Count: 0
    1 row selected.
    SQL>

  • Problem with a text field check

    When there is nothing placed inside the text field it will return a message dialog box saying that there is nothing located inside the text field. However if there is something inside the text field it will perform a
    doSpellingSuggestion and write the results to a .txt file.
    This works as the search term can be found within the .txt file.
    However when I try to display a message dialog box to display the contents of the .txt file that contains the spelling suggestion it will come out with an error from the catch statement
    catch(Exception spelling_error)
    JOptionPane.showMessageDialog(null , "Spelling error = " +
    spelling_error.getMessage());
    It keeps showing an error message box saying "Spelling error = null"
    It wont go past this line and thats the problem that i have. I tryed putting
    I tried substituting this in place of the error message above but it wouldnt go down to it
    //Display a message with a spelling suggestion
    JOptionPane.showMessageDialog(null , "Did you mean to spell " +
    search_term + " like this " + buffer.toString());
    but this didnt work
    class spellcheck_button_listener implements ActionListener
    public void actionPerformed(ActionEvent spelling_check)
    try
    String myKey = "0RK+HoNQFHJlcbNPfxgBpcjESUWV96aO";
    String wsdl = "http://api.google.com/GoogleSearch.wsdl";
    String url = "http://api.google.com/search/beta2";
    String ns1 = "urn:GoogleSearch";
    String ns2 = "urn:GoogleSearch";
    if((search_field.getText() == null) || (search_field.getText().equals("")))
    JOptionPane.showMessageDialog(null , "No search term entered in text field"
    + " please enter another search term");
    else
    search_term = search_field.getText();
    //Create the connection
    SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
    SOAPConnection connection = soapConnFactory.createConnection();
    //Create the actual message
    MessageFactory messageFactory = MessageFactory.newInstance();
    SOAPMessage message = messageFactory.createMessage();
    //Create objects for the message parts
    SOAPPart soapPart = message.getSOAPPart();
    SOAPEnvelope envelope = soapPart.getEnvelope();
    SOAPBody bodyName = envelope.getBody();
    SOAPElement bodyElement;
    //Populate the message by adding SOAP body elements to form a semantically meaning
    //SOAP request
    bodyElement = bodyName.addBodyElement(envelope.createName("doSpellingSuggestion" , "ns1" , ns1));
    //Adding content to the message
    //addTextNode used when entering strings , addAttribute used for integers
    bodyElement.addChildElement(envelope.createName("key")).addTextNode(myKey);
    bodyElement.addChildElement(envelope.createName("q")).addTextNode(search_term);
    //Send the message and get a reply
    URLEndpoint endpoint = new URLEndpoint(url);
    //Send the message
    SOAPMessage reply = connection.call(message , endpoint);
    //Getting the content of a Message
    SOAPPart sp = reply.getSOAPPart();
    SOAPEnvelope env = sp.getEnvelope();
    SOAPBody replyBody = reply.getSOAPPart().getEnvelope().getBody();
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Source styleSheet = new StreamSource(translate_file);
    Transformer transformer = transformerFactory.newTransformer(styleSheet);
    Source sourceContent = reply.getSOAPPart().getContent();
    StreamResult result = new StreamResult(spell_check_file);
    transformer.transform(sourceContent, result);
    java.util.Iterator iterator = replyBody.getChildElements();
    while (iterator.hasNext())
    bodyElement = (SOAPBodyElement)iterator.next();
    String url_results = bodyElement.getValue();
    //Close the connection
    connection.close();
    FileReader inputFile = new FileReader(spell_check_file);
    buffer = new StringBuffer();
    // write new list to standard out
    BufferedReader in = new BufferedReader(inputFile);
    String input;
    while ((input = in.readLine()) != null)
    if(!input.startsWith("<?xml version"))
    // Skip XML header
    buffer.append(input + "\n");
    in.close();
    //Display a message with a spelling suggestion
    JOptionPane.showMessageDialog(null , "Did you mean to spell " + search_term +
    " like this " + buffer.toString());
    } //End of else statement
    } //End of try method for search action performed
    catch(Exception spelling_error)
    JOptionPane.showMessageDialog(null , "Spelling error = " +
    spelling_error.getMessage());
    } //End of method actionPerformed for search button
    } //End of class spellcheck_button_listener implements ActionListener

    I don't use SOAP, so I can't test your code.
    If you really want people to read your code then it should be [url http://forum.java.sun.com/features.jsp#Formatting]formatted so it is readable with correct indentation of lines and highlighting of the source code.

  • Problem with long text field.

    Hi all,
    I have a problem when I try to concatenate two fields.
    It seems the new field only is 254 characters long?
    Here is my syntax:
    data: w_long_text(1000).
    clear w_long_text.
        loop at iline.
          concatenate w_long_text iline-tdline into w_long_text separated by space.
        endloop.
    I'm sure the text is longer then 254 becuase I can see the text in an Activity in the Sap Crm system.
    Best Regards
    Frode

    Hi thomas
    wat i would suggest you is better take an internal table with long_text(255) field .
    data : begin of it_text occurs 0,
                long_text(255),
              end of it_text.
    clear : w_long_text,it_text.
    loop at iline.
    concatenate w_long_text iline-tdline into w_long_text separated by space.
    <b>it_text-long_text = iline-tdline.</b>
    append it_text.
    clear it_text.
    endloop.
    and when displaying the text keep that in a loop and print it.
    This way u can display the whole text irrespective of the char length.
    Reward points if helpful
    Regards
    Zarina

  • Problem with ios certificate server not updating the CRL

    Hi all,
    The background is that i'm currently setting up a DMVPN solution with the ipsec tunnels between the spokes created using certificates.
    I'm using a cisco 877 as the CA server (its running 12.4(6)T5) to provide the certificates to the spoke routers. This part is working fine - the spokes can request a certificate and get one issue all well and good.
    The problem is on the CA, the CRL lifetime is set to 24 hours but the CA is not updating the CRL so when the spokes look for the revocation list (as set in their trustpoint) they are reporting an error that the CRL is out of date and won't connect.
    If is do a '#sh crypto pki server' it lists a 'CRL NextUpdate timer. this has a timestamp that is 24 hours after the last certificate was revocked. The only way i can get the CRL to be re-generated is to revoke a certificate.
    So, my question is, have i missed something here? I thought the CA would automatically generat a new CRL file every 24hours.
    Can anyone help?
    thanks.

    Hi Mark (?)
    this seems to match this bug:
    CSCsy95838    IOS CA: CRL not updated, update timer no started
    However it does not mention if 12.4(6)T5 is affected, only that it was found in 12.4(15)T3 and resolved in 12.4(15)T10 and other more recent releases.
    I would suggest trying the latest 12.4(15)Tx, 15.0(1)Mx or 15.1(4)Mx release if you can.
    I supposed you've though of it, but just in case: as a workaround you can disable the CRL check on all the DMVPN routers, obviously they will still allow connections from routers with a revoked spoke.
    As a (temporary?) replacement for a CRL, you could use a "certificate ACL" with which you can kind of create a "manual local CRL" :
      crypto pki certificate map certACL 10
       serial-number ne
       serial-number ne
       etc.
      crypto pki trustpoint myTP
       match certificate certACL
    (note the "ne" stands for "not equal" so you are permitting any certificate whose serial number is not listed)
    Obviously you would have to configure (and maintain!) this on each router participating in the DMVPN so this is cumbersome, but I suppose if you don't often revoke certs it might be an option.
    hth
    Herbert
    If this post answers your question, please click the "Correct Answer" button

  • Problem with validating text field

    Hi All
    i want to validate the text fields present in jsp page for a sturts application..
    i have a jsp page for input then struts form for validation as struts machinism provides and if error occurs it add error to error object.
    i want to display error message in text field when it occurs..
    plz help me to do it
    thanx in advacne

    I'm not getting your requirement clearly, by my understanding ... you need to retrieve database whenever a <select> field trigger "onchange" - am I right?
    If that is your requirement, it depends on what kind of solution you are looking into?
    1. AJAX+Servlet (dojo/jMaki/write your own)
    2. Java Server Faces (MyFaces/JSF)
    3. write yourself a custom TAG (JSTL) to do the purpose (AJAX+Servlet/purely Servlet)
    4. purely JSTL
    5 purely Servlet
    (please "Google" them by appending "<select> <option>"/ "populate combobox")
    Personally I would recommend 1st or 3rd approach, even 2nd approach (MyFaces/JSF) is cool, but if your whole application is not written in JSF, no point to mixed the solutions.
    If you want to try Ajax+TAG approach, refer following:
    http://ajaxtags.sourceforge.net/
    If you wish to use MyFaces approach, please refer following:
    http://avatar21.superihost.com/index.php?entry=entry051020-163838
    A forth/fifth approach will be much browser-portable, but the amount of coding will be more.
    Regards,
    Avatar Ng
    Message was edited by:
    Avatar_Ng
    Message was edited by:
    Avatar_Ng

  • Problem  with Input Text Field

    I am trying to use the binding tag for a inputText field... The value of the text Field is a hashmap, in which the key is equal to the binding variable i have used
    <h:inputText id="ug" binding="#{userBean.ugclassCode}" rendered="true" value="#{userBean.finalUghm}" styleClass="numericalignRight" />
    This is the first time i m trying binding to an inputText so please let me know if this method is correct... and please let me know if there is any other method to accomplish the same.
    Thanks in advance

    Maybe you misunderstand the binding attribute ..
    Two ways to get it work:
    Way 1:
    JSF 1<h:form id="form">
         <h:inputText binding="#{MyBean.inputText}" />
    </h:form>MyBean 1    private HtmlInputText inputText = new HtmlInputText();
        private Map inputValues = new HashMap();
        public HtmlInputText getInputText() {
            inputValues.put("key1", "testvalue1"); // test
            inputText.setValue(inputValues.get("key1"));
            return inputText;
        public void setInputText(HtmlInputText inputText) {
            this.inputText = inputText;
        }Way 2:
    JSF 2<h:form id="form">
         <h:inputText value="#{MyBean.inputValue}" />
    </h:form>MyBean 2    private Map inputValues = new HashMap();
        private String inputValue;
        public String getInputValue() {
            inputValues.put("key2", "testvalue2"); // test
            inputValue = (String) inputValues.get("key2");
            return inputValue;
        public void setInputValue(String inputValue) {
            this.inputValue = inputValue;
        }

  • Problem with ME_PROCESS_PO_CUST setting fields to update..

    I try to add new fields to a purchase order, everything works fine, I added the fields in CI_EKPODB and CI_EKPODBX
    also changed structure ZPO_CUST_FIELDS and changed the screen in SAPLZ_PO_CUST_FIELDS
    ME_GUI_PO_CUST  is implemented ( it already was since we already had custom fields)
    in ME_PROCESS_PO_CUST we have FIELDSELECTION_ITEM where I can set if the field needs to be editable or not.
    for 1 field that has happenend in the past and the code reads
    IF gt_trtyp NE 'A'.           " Transactietype <> Weergeven
        READ TABLE ch_fieldselection ASSIGNING <fs>
             WITH TABLE KEY metafield = mmmfd_cust_10.
        IF sy-subrc EQ 0.
          <fs>-fieldstatus = '.'.     " Veld is wijzigbaar
        ENDIF.
      ENDIF.
    when I check out the  mmmfd_cust_10 I see that it is somehow linked to the old custom field
    now I added more custom fields but I can't find there needed mmmfd fields ??
    do they need to be generated somehow ? I can't find anything in the documentation or sdn about those fields ?
    so the fields are visible in me22n but I have to set them to editable ! if there are more sollutions to this problem I'm glad to hear
    kind regards
    arthur de smidt

    I was under the impression that the mmmf fields were added when new fields were added. seems that you can only use the 10 fields available

  • Problem with long text field in PLD

    Hi all.
    I´m doing a layout for A/R invoices. I have a user field of text type. When I try to display this field and the text is too long the PLD make a new line. but in the first line cut me some characters. How can I fix this issue?
    Can you help me?
    Thanks

    The Aligment properties are:
        *Horizontal: Left
        *Vertical: Top
        *Line break: Divide into rows
        *Length:
        *Filler:
        *Field haight adjustment: checked
        *Sum in words: Not checked
        *Suppress zeros: Not checked

  • Problem with append += text in Text Field

    Hi guys
    i have a problem with append text.
    I have one array which contain some city names, like CityArea=["NAME 1", "NAME2" ...etc];
    Then i have one String and one Text Field.
    Using for loop im getting right results. But when im running script again then im getting  same text again.
    F.ex.
    First time:
    City name: Name 1
    City name: Name 2
    Second time:
    City name: Name 1
    City name: Name 2
    City name: Name 1
    City name: Name 2
    I have tried to make TextField to and String to Null and delete it, but it's appearing again.. :/
    How to avoid this?
    Here is script:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    _CityAreaTF1 = new TextField();
      _CityAreaTF1.border = true;
      _CityAreaTF1.wordWrap = true;
      _CityAreaTF1.multiline = true;
      _CityAreaTF1.selectable = false;
      _CityAreaTF1.antiAliasType = AntiAliasType.ADVANCED;
      _CityAreaTF1.name = "CityAreaTF1";
      _CityAreaTF1.embedFonts = true;
      _CityAreaTF1.htmlText = _CityAreaString1.toUpperCase();

    I think i found why.
    There was no problem with TextField.
    There was a problem with Array. "CityArea"
    So each time I executed script it added new string in Array. And that is because i got like:
    TextField
    City 1
    City 2
    City 1
    City 2
    Running this script is Ok:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    But outside of this for loop there is another for loop for adding Cities in CityArray.
    I fixed it by adding empty array at the start of function
    function myFunc():void
    CityArea = [ ]; // Empty array fixed this issue
    // LOOP FOR ADDING SHOPS IN CITY AREA
    for (var j:int = 0; j < _Shops; j++)
    CityArea.push(_Shop);
    // FOR LOOP TO ADDING SHOPS IN STRING
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    Thank you for your help kglad

  • Got big problem with my iphone , its not charging as it did before i updated (5.0.1) Now its charging very slowly and it doesnt show the charging sign on screen..

    got big problem with my iphone4 , its not charging as it did before i updated (5.0.1) Now its charging very slowly and it doesnt show the charging sign on screen..

    How do you know its charging very very slowly? Is the screen back on?
    Once a month you should charge your phone to 100% then drain it, then charge it back up to 100%.
    Just leave the phone in and do what is said above.
    How long do you think it will take to charge to 100%?

  • Text Fields Not Showing in Design or Live View

    Hello Everyone,
    I have run into a problem trying to create a simple contact form through Dreamweaver CS6.  I have two text fields for Name & Email, and 1 text area for Comments.  The issue I am running into is that the text fields are not showing in Design or Live view.  I have set-up all variables required for the server for the form to work... but that should not have any effect on the text field showing...  I tried uploading my contact page with the same result of no text fields showing...
    What is really laughable is that the "text area" I placed in my form for Comments shows up in Design & Live view just fine.  I am thinking that I am missing something, but just do not know what exactly.  The form is styled through CSS.
    Here is the form code:
         <div id="CRDForm">
           <form action="http://www.sweetformimi.com/formmail/formmail.php" method="post" enctype="application/x-www-form-urlencoded" name="contact" target="_self" id="contact">
        <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
        <input type="hidden" name="recipients" value="[email protected]" />
        <input type="hidden" name="subject" value="Contact Form" />
             <label><p>Your Full Name
               <input name="Name" type="text" id="Name" size="40" /></p>
             </label>
             <label><p>Email
             <input name="email" type="text" accesskey="2" tabindex="2" title="Email" value="Email"></p>
             </label>
             <label>Comments<br />
             <textarea name="comments" cols="40" rows="10" accesskey="3" tabindex="3" title="Comments"></textarea>
             </label>
             <input name="submit" type="submit" accesskey="4" tabindex="4" title="submit" value="submit">
           </form>
        </div>
    Are there other variables I should be thinking about in the rest of my site?  I am using a fluid grid layout.  I have CSS for desktop, tablet, and phone devices.  I also have a primary CSS file that imports all three.  The sites structure was done by using <header>, <article>, <footer>, and of course <div> tags. 
    Has anyone ever experienced the "text fields" not showing up before? Is it a simple fix as reinstalling Dreamweaver CS6?  Finally, another thing I should mention is that I did have a previous version of Dreamweaver on my comp, which was CS3.  I did not uninstall that before installing the newer version.  I assumed (and I could be wrong here) that it would automatically replace the older version.
    I apoligize for it being long winded, but I am looking for some help on this issue...
    Thank You

    Hey thank you osgood for the reply!
    When I look at code for long hours it sort of blurs together, and I miss things... I think that happens to the most of us
    Ya I found what was blocking my text fields in my desktop.css
    I primarily work through code view, and currently working on quite a few projects kind of makes your eyes miss the small errors.
    Thanks again!

Maybe you are looking for