Having problems setting text to a JLabel!!

HI *.*,
i'm having problems setting text to a JLabel.
i have a JFrame with a JPanels and on the JPanel i have a JLabel.
I have a text field wihich is used to input text.
So, i'm using textField.getText() to read the text of the text field and setText() to write it to the Label.
but setText() isn't displaying the text on the label.
I'm using NetBeans as an ide
Does anyone have any ideas??

Here is some code
public class AddClass extends JFrame implements ActionListener{
    public AddClass() {
        initComponents();
    }//end of 1st constructor with initComp
    //initComponents
    private void initComponents() {
        getContentPane().setLayout(new java.awt.GridLayout(3, 1));
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        prodPanel.setLayout(new java.awt.GridLayout(1, 3));
        prodPanel.setBackground(new java.awt.Color(255, 255, 255));
        prodPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Production", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12)));
        westPanel.setLayout(new java.awt.GridLayout(6, 0));
        westPanel.setBackground(new java.awt.Color(255, 255, 255));
        westPanel.add(westLab1);
        westLab2.setBackground(new java.awt.Color(255, 255, 255));
        westLab2.setFont(new java.awt.Font("Arial", 1, 36));
        westLab2.setForeground(new java.awt.Color(0, 204, 0));
        westLab2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        westLab2.setIcon(new javax.swing.ImageIcon("C:\\icontexto-webdev-bullet-048x048.png"));
        westLab2.setText("MQ 35");
        westLab2.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        westLab2.setIconTextGap(10);
        westLab2.setInheritsPopupMenu(false);
        westPanel.add(westLab2);
        westPanel.add(westLab3);
        westPanel.add(westLab4);
        westPanel.add(westLab5);
        prodPanel.add(westPanel);
        setJMenuBar(menuBar);
        setTitle("Broker Monitor");
        this.setSize(700, 700);
        BrokerWindowCloser brkWindowCloser = new BrokerWindowCloser();
        this.addWindowListener(brkWindowCloser);
        pack();
        //       setVisible(true);
    }//end of initComponents
    public AddClass(String st) {
        initComponents();
        westLab6.setVisible(true);
//        System.out.println("in broker  " + st); 
        westLab6.setText(st);
        System.out.println(st);
        westLab6.setBackground(new java.awt.Color(255, 255, 255));
        westLab6.setFont(new java.awt.Font("Arial", 1, 36));
        westLab6.setForeground(new java.awt.Color(0, 204, 0));
        westLab6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        westLab6.setIcon(new javax.swing.ImageIcon("C:\\PNG\\icontexto-webdev-bullet-048x048.png"));
        westLab6.setEnabled(true);
        westLab6.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        westLab6.setIconTextGap(15);
        westLab6.setInheritsPopupMenu(false);
        westPanel.add(westLab6);
//       this.validate();
        westPanel.repaint();
    public void actionPerformed(ActionEvent ae) {
        Object source = ae.getSource();
        if(source == exitMI) {
            System.exit(0);
        }//end of if exitMI
        if(source == addMI){
            new AddMQ_1_1();
        if(source == removeMI){
            new RemoveMQ_1();
    }//end of actionPerformed
    class BrokerWindowCloser extends WindowAdapter {
        public void windowClosing(WindowEvent we) {
    }//end of windowcloserclass
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new AddClass().setVisible(true);
    }//end of main
}// End of variables declaration
   public void addButtonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
        Object source = evt.getSource();
        if(source == addButton){
            System.out.println("here");
            String st = mqNameJTF.getText();
            Broker1 br = new Broker1(st);
            AddClass adc = new AddClass(st);
            this.repaint();
this.dispose();
        }//end of if addButton
    }//end addButtonActionPerformed

Similar Messages

  • I'm having problem with text boxes.  Whenever i hit the enter button to start a new line or paragraph, the cursor doesn't drop down to the next line.  Instead i get this little red + sign in the box.

    I'm having problem with text boxes.  Whenever i hit the enter button to start a new line or paragraph, the cursor doesn't drop down to the next line.  Instead i get this little red + sign in the box.

    You are absolutely right.  Thought Enter meant Enter.  I was wrong.  Thank you for the help.
    Rod Rogers, Broker
    Accredited Land Consultant (ALC)
    Metcalf Land Company, Inc.
    Office: 864-585-0444
    Mobile: 864-316-0297
    Fax: 864-583-6000
    <http://www.metcalfland.com> www.metcalfland.com

  • Im having problem setting up my Hotmail account, it used to work fine until few days ago. It says ive entered an incorrect username or password which i can sign in fine with them details if i use laptop or safari through the phone, Please help..

    Im having problem setting up my Hotmail account, it used to work fine until few days ago. It says ive entered an incorrect username or password which i can sign in fine with them details if i use laptop or safari through the phone, Please help..

    I Sugges you to log into your hotmail acc and go to security and password change bit, then you will see two-step verification.. turn that off and you will be able to set it up on your iPhone/iPad or even Mac.
    Give your phone a restart before trying to set it up. Thanks

  • Having problems with texts width when viewed in Firefox

    I My site is OK when viewed in Chrome and Safari, but in Firefox, the width of paragraphs is becoming very long and all is displayed wrong.
    I need a clue where to look to fix. I have not , or very little knowledge of HTML code. So I rely on the DW CS5 interface.
    Thanks,D.

    Thanks Nancy ,
    I'll try,
    Should I just paste your info between the brackets, I guess.
    I am not so good with this but I need to spent a bit of time to fix this
    old web site while another one is being designed.
    Yes the images are too big, I'll reduce them, and optimize. This was
    done in a rush..
    D.
    Le 14-02-23 18:07, Nancy O. a écrit :
    >
          Re: Having problems with texts width when viewed in Firefox
    created by Nancy O. <http://forums.adobe.com/people/Nancy+O.> in
    /Dreamweaver support forum/ - View the full discussion
    <http://forums.adobe.com/message/6149874#6149874

  • HT1277 having problem setting up a second email account

    I am having problems setting up a second email account on my imac.  help!

    In the Add Account dialog, enter the information, then hold down the option key and click Continue. Finish setting up the account manually.

  • I'm having an unusual problem with my iphone 4S. When I'm making a call, it suddenly sounds like my call has been invaded by aliens! Why is it doing this? I'm also having problems sending texts. Sometimes it sends sometimes it doesn't.

    I'm having an unusual problem with my iphone 4S. When I'm making a call, it suddenly sounds like my call has been invaded by aliens! Why is it doing this? I'm also having problems sending texts. Sometimes it sends sometimes it doesn't. What is going on? Can it be fixed? I'm really not liking this new phone!!!!

    Could be an issue with your Carrier and/or location...
    The Basic Troubleshooting Steps are:
    Restart..  Reset..  Restore from Backup...  Restore as New...
    Try a Reset...
    Press the sleep/wake button & home button at the same time, keep pressing until you see the Apple logo, then release the buttons...
    http://support.apple.com/kb/ht1430

  • Having problems setting up ntlworld email on ipad 2. Help?

    I am having problems setting up my ntlworld email on my new ipad 2. It works ok on my iphone 3. Trying to use the same settings as my iphone but its not setting up.

    This should work for all email addresses managed by Virgin Media
              @ntlworld.com
              @blueyonder.co.uk
              @virgin.net
              @virginmedia.com
    1. Turn on Settings > Airplane Mode.
    2. Open Settings > Mail, Contacts, Calendars.
    3. Tap Add Account….
    4. From list choose Other.
    5. Choose Add Mail Account.
    6. In the New Account screen enter customer’s:
              Name (e.g. Johnny Appleseed)
              Email (full email address, e.g. [email protected])
              Password (password for email address)
              Description (this will automatically get filled in, but you can put something more meaningful e.g. ‘NTLWorld Email’)
    7. Tap Next.
    8. In the next screen ensure IMAP is selected.
    9. Enter the following settings:
              Incoming Mail Server (section)
              Host Name imap.virginmedia.com
              User Name (full email address, e.g. [email protected])
              Password (password for email address)
              Outgoing Mail Server (section)
              Host Name smtp.virginmedia.com
              User Name (full email address, e.g. [email protected])
              Password (password for email address)
    10. You will get an error that the IMAP server is not responding (Airplane Mode being on); just tap OK.
    11. Tap Next.
    12. You will get an error that the account may no be able to send or receive emails; tap Save anyway.
    13. On next screen turn Notes off and tap Save.
    14. The new account should be created; we now need to tweak some settings in it.
    15. Tap the new account in the list.
    16. On the next screen tap Account.
    17. Where is says Outgoing Mail Server tap on SMTP smtp.virginmedia.com >.
    18. On the next screen, under Primary Server, tap smtp.virginmedia.com.
    19. Ensure the settings are as follows:
              Outgoing Mail Server (section)
              Host Name smtp.virginmedia.com
              User Name (full email address, e.g. [email protected])
              Password (password for email address)
              Use SSL is turned ON
              Authentication Password
              Server Port 465
    20. Tap Done.
    21. You will get an error that the SMTP server is not responding; just tap OK.
    22. Tap Done.
    23. You will get an error that the account may no be able to send or receive emails; tap Save anyway.
    21. Tap Account to go back one screen.
    22. Tap Advanced at the bottom of the screen.
    23. At the bottom of the screen ensure the settings are as follows:
              Incoming Mail Server (section)
              Use SSL is turned ON
              Authentication Password
              IMAP Path Prefix is left blank (will show ‘/’)
              Server Port 993
    21. Tap Account to go back one screen.
    22. Tap Done.
    23. You will get an error that the IMAP server is not responding; just tap OK.
    24. Tap Done.
    25. You will get an error that the account may no be able to send or receive emails; tap Save anyway.
    26. Tap Mail… to go back one screen.
    27. Tap Settings to go back one screen.
    28. Turn Airplane Mode to OFF.
    29. Press Home button and open Mail app to check it is now collecting and sending email.

  • HT4191 I have iPhone 4s and i am having problem sending text messages

    I have iPhone 4s and i am having problem sending text messages

    You will have to contact your phone carrier as they handle messaging.

  • Having problems sending text messages since I updated

    Having problems sending text messages since updating. And have to login every time I go to text message

    troubleshooting message http://support.apple.com/kb/ts2755
    Do you have MMS turn on in Settings?
    Are you provisioned by your carrier to use MMS?
    Lastly, give your phone carrier a call, as MMS is a carrier feature.

  • Recently having problems receiving texts from my wife, but noone else that I am aware of. She is a Verizon as well

    recently having problems receiving texts from my wife, but no one else that I am aware of. She is a Verizon as well

    I'm very sorry for any trouble with messages, kmorr1. I'm determined to assist you in getting this resolved. Can you provide some details? What happens when you try to get messages from her? Which model device do you use? How about her device model? When did you first notice this?   DionM_VZW Follow us on Twitter @VZWSupport If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • Having problems setting up iMessage

    I'm having problems setting up iMessage on my iPod Touch.  I have several iphones and they all were configured out problems.  But I'm having difficulty getting this to work on an iPod touch.
    The iPod touch has been upgraded to the latest iOS 5.01 from  iOS 5.0 and I still have problems...
    I have a valid iCloud account
    iCloud is setup and working fine on this iPod touch
    I've shut-down and restarted the iPod touch
    I've done a hard-reset
    Wifi is setup properly...
    Here's the issue:
    I open iMessage (either through the Messages app, or via Settings/Messages
    I'm asked to enter the Apple ID.  So I enter my Apple ID and password
    I click "Sign In"
    The app moves to the next screen - "People will message you using your email address.  What email address would you like to use?".  I enter the same gmail address I'm using for my Apple ID
    I click the Next button and it scrolls back to the original "Enter Apple ID" sign in screen in Step#2.   No error message appears.
    So I don't really know what to try next..

    OK - solved my own issue finally.
    The answer was buried in another thread within a reply from user fdm1979.
    The time on this particular iPod was wrong...just flip the Date/Time to "Set Automatically", and then suddently imessage and FaceTime started working.

  • Having problems with text, lines overlap each other

    Good Afternoon, I am having problems in pages, address book, text Edit. In pages and text edit the lines overlap each other and in address book I cannot read clearly the information of my contact because line also overlap. Does anyone knows how can I arrange this?
    Thank you very much,
    Melissa

    THANK YOU SO MUCH stussaar!
    My Mother did what you said for the Spam and my number was in there about 100 times. She deleted all them. Deleted me as a contact and then rebooted, then she text me and I text her back and I went right into the Spam again. I told her to tell TMobile this so then can maybe help and remove my number from Spam on their end.\
    Thanks you so much! you got us 99.999 % the way there!!
    I appreciate your help!!!!  I hope this worked also for your problem!!
    Thanks again!!!
    Mike

  • Having problems setting up pop3 email on N97

    I have asked over on the Vodafone forum, but not had an answer, so I'n not sure if any of you can advise ?
    I Cannot recieve or send emails on my virgin email account and I also have issue with the following email accounts :
    Virgin.net  ( cant recieve or send)
    Sky.com ( can recieve but not send )
    123.reg ( can recieve but not send ).
    I Can recieve emails via Wifi on my sky account, but cannot send emails by mobile internet on the same account, same goes for a 123 reg pop3 account ( can recieve but not send ).
    I've tried a software update, resets , deleting and re-entering the email accounts and nothing changes :
    I'm obviously doing something wrong, but am stumped ?

    hi Ian
    First you have to do setting on you email account if needed so you can start receiveing email on mobile, also depend that email provider, do support email on mobiles or not if yes they might ask you to pay then again you have use  trick to fix it.
     now on n97 when you setting email address then do not put you email in setting put some thing which do not exi(not valid email address)t then it will ask you not vaild email with option to put manually email address, now you put your right email, then you can start receiving an email.
    still haveing problem let me know which stage.

  • This is my first iPad and am having problems setting up apple ID message tells me ID is not verified - help, feel such a wimp!

    This is my first I-product and I am having problems getting going. Can't buy apps as ID is not verified - I have tried but no luck, help!

    When you sign up with an e mail address, apple will send an e mail to that address to verify it is really your, and that you are the one setting up whatever you are doing.  The same process happens if you change your e mail, or add an additional e mial.
    So watch you in box in that e mail account for an e mail from apple.  You need to respond to it to confirm the set up.
    If your provider has a spam filter, check in there.  Some aggresive spam filters block the apple e mail.
    Lastly, some report that they never get the email, cannot respond, therefore cannot set up whatever they are trying to set up.  If that happens, try an alternate e mail address if you have one.

  • HT204053 I'm having problems setting up my I cloud account help I let on entering the same apple I'd I have still nothing

    Having problems logging into my iCloud account I keep using the same email address help please.

    Where is it you are trying to enter your email address, what exactly are you trying to do. If you enable mail syncing in your iCloud settings, your mail account is automatically set up for you, you do not need to enter any of the details yourself.

Maybe you are looking for

  • Unable to use or the back arrow & has stop working

    unable to use the back arrow , will not work on any site, just stop working thanks

  • How can I ensure that the audio sample rate of my capture preset matches?

    Hi 1. I have found that none of my ten projects has sound, although audio meters & settings moves up & down. Simultaniously, canvas displays that In: Not Set- & Out Not Set. Below those reads: Video V1: 00:03:42;13 Audio A1: 00:03:42;13 A2: 00:42;13.

  • Dulicacy of field values in the CSV file

    Hi Experts We are configuring a file to idoc scenario in which the file is a .csv txt file. The format of the csv file is NMI,BillNo,BillAmount,ContractAcc There are instances where there is a duplicacy in the NMI & hence that needs to be filtered be

  • Function module needed

    is there a finction module which converts the format of the amount from __,__,__,__.__ to __.__.__.__,__ ? Please help. i need the solution immediately. Thanx in advance.

  • Designer plugin fails creating eclipse projects

    Hello, I've installed: -SUN j2sdk1.4.2_05 -Eclipse 3.0.1 -BPEL Designer (bpelz_0.9.10) -BPEL Process Manager 2.1.2 I try to create a BPEL Project as shown in "Tutorial 1: developing a hello world bpel process", after pressing "finish" in "create a BP