Buttons in panels that doent work..

hi all.
im currently developing an application where panels are switched on a frame.
each panel has its own actionlistener, and is working.
the problem is that the buttons i create in a panel get a null value when an action event occurs.
you can see the code below. (the problem is visible in the class hoofdmenu)
import java.awt.*;
import java.awt.event.*;
public class Metrio extends Frame implements WindowListener
     private Panel vorige;
     private hoofdMenu begin;
     private Leerling leer;
     private Vak vak;
     private Rapport rap;
     private Gebruiker gebruik;
     public static void main(String[] args)
          //g=f.getGraphics();
          //this.requestFocus();
          Metrio metrio =     new     Metrio();
          metrio.show();
     public Metrio()
          setTitle("cijfer registratie systeem");
          setSize(600,600);
          setLayout(new FlowLayout());
          addWindowListener(this);
          begin = new hoofdMenu(this);
          leer = new Leerling(this);
          vak = new Vak(this);
          rap = new Rapport(this);
          gebruik = new Gebruiker(this);
          setPaneel(0);
          //addActionListener(begin);
          requestFocus();
     public void     setPaneel(int paneel)
          if(vorige != null)
               remove(vorige);
               System.out.println(""+vorige+" begin="+begin);
          switch(paneel)
               case 0 : add(begin); vorige = begin; break;
               case 1 : add(leer); vorige = leer; break;
               case 2 : add(vak); vorige = vak; break;
               case 3 : add(rap); vorige = rap; break;
               case 4 : add(gebruik); vorige = gebruik; break;
          requestFocus();
          repaint();
     public void     paint(Graphics g)
     public void     windowOpened(WindowEvent e){}
     public void     windowClosing(WindowEvent e){System.exit(1);}
     public void     windowClosed(WindowEvent e){}
     public void     windowIconified(WindowEvent     e){}
     public void     windowDeiconified(WindowEvent e){}
     public void     windowActivated(WindowEvent     e){}
     public void     windowDeactivated(WindowEvent e){}
class hoofdMenu extends Panel implements ActionListener
     private     Metrio f;
     //private leerling leer;
     private     Button l, v, r,     g;
     public hoofdMenu(Metrio fr)
          f=fr;
          Button l = new Button("leerling");
          add(l);
          l.addActionListener(this);
          System.out.println("l2 = "+l);   // l is full here
          Button v = new Button("vak");
          add(v);
          v.addActionListener(this);
          Button r = new Button("rapport");
          add(r);
          r.addActionListener(this);
          Button g = new Button("gebruikers");
          add(g);
          g.addActionListener(this);
          System.out.println("l3 = "+l);
     public void     actionPerformed(ActionEvent     e)
          System.out.println("een     knop gedrukt!");
          System.out.println("e =     "+e.getSource());
          System.out.println("l =     "+l);             // l IS NULL HERE?????
          if(e.getSource() ==     l)
               System.out.println("ik ben er in!!!");
               f.setPaneel(1);
               System.out.println("leerling knop gedrukt!");
          System.out.println("v =     "+v);
          if(e.getSource() ==     v)
               f.setPaneel(2);
          if(e.getSource() ==     r)
               f.setPaneel(3);
          if(e.getSource() ==     g)
               f.setPaneel(4);
class Leerling extends Panel implements     ActionListener
     private     Metrio f;
     //private Panel ouder;
     private     Button b;
     public Leerling(Metrio fr)
          f=fr;
          //this.ouder = ouder;
          Button b = new Button("terug leerling");
          add(b);
          b.addActionListener(this);
     public void     actionPerformed(ActionEvent     e)
          f.setPaneel(0);
}thanks in advance,
robert

Your (l, v, r, g) buttons are re-declared locally in your hoofdMenu() constructor... that's why they are null-referenced outside of the method. So, your code should read: public hoofdMenu(Metrio fr)     {
   f=fr;
   l = new Button("leerling");
   add(l);
   l.addActionListener(this);
   System.out.println("l2 = "+l);   // l is full here
   v = new Button("vak");
   add(v);
   v.addActionListener(this);
   r = new Button("rapport");
   add(r);
   r.addActionListener(this);
   g = new Button("gebruikers");
   add(g);
   g.addActionListener(this);
   System.out.println("l3 = "+l);
}Hope this helped,
regards.

Similar Messages

  • Only one button on panel seems to work

    hi all, i have a question regarding this app i am attempting to make. it is supposed to act like a number pad where the user clicks buttons to add an amount to a jtextfield. then click one of four buttons to convert to euros, yen, or rubles. the code seems to be right, but i must be missing something because for some reason only the euros button works, and it says it converted to rubles. ive been stuck here for quite some time, so any help would be much appreciated
    import  java.awt.*;
    import  java.awt.event.*;
    import  javax.swing.*;
    import  java.util.*;
       A GUI application that uses grid layout to
       play tic tac toe
       @author Jared Letendre
       @version 10-05-07
    public class DollarConverter
           creates a BetterCostFrame
           @param args not used here
        public static void main(String args[])
             ConvertFrame mainFrame = new ConvertFrame();
             mainFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );   
             mainFrame.setVisible(true);
    class ConvertFrame extends JFrame
           constructs a ConverterFrame instance
        public ConvertFrame()
             this.setTitle("Dollar Converter");
             this.setSize(this.DEFAULT_WIDTH, this.DEFAULT_HEIGHT);
             OuterPanel panel = new OuterPanel();
             this.add(panel);
        private final static int DEFAULT_WIDTH = 550;
        private final static int DEFAULT_HEIGHT = 350;
    class OuterPanel extends JPanel
           constructs a MainPanel panel instance
        public OuterPanel()
             this.setLayout(new BorderLayout());
             // northern panel
             JPanel dollarPanel = new JPanel();
             JLabel dollarLabel = new JLabel("U.S. Dollars: " + " $");
             dollarLabel.setForeground(this.COLOR_1);
             dollarLabel.setFont(this.FONT);
             dollarOutput = new JTextField("", 10);
             dollarOutput.setEditable(false);
             dollarOutput.setHorizontalAlignment(JTextField.RIGHT);
             dollarPanel.add(dollarLabel);
             dollarPanel.add(dollarOutput);
             this.add(dollarPanel, BorderLayout.NORTH);
             // southern panel
             JPanel bottomPanel = new JPanel();
             JLabel equalsLabel = new JLabel("Equals...");
             resultsLabel = new JLabel(" By: Jared Letendre");
             equalsLabel.setForeground(this.COLOR_1);
             equalsLabel.setFont(this.FONT);
             resultsLabel.setForeground(this.COLOR_1);
             resultsLabel.setFont(this.FONT);
             convertedOutput = new JTextField("", 10);
             convertedOutput.setEditable(false);
             convertedOutput.setHorizontalAlignment(JTextField.RIGHT);
             bottomPanel.add(equalsLabel);
             bottomPanel.add(convertedOutput);
             bottomPanel.add(resultsLabel);
             this.add(bottomPanel, BorderLayout.SOUTH);
             // western panel
             JPanel buttonPanel = new JPanel();
             buttonPanel.setLayout(new GridLayout(0, 1, 5, 5));
             buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 65, 40, 65));
             JButton toEuros = new JButton("To Euros");
             JButton toYen = new JButton("To Yen");
             JButton toRubles = new JButton("To Rubles");
             JButton clear = new JButton("Clear");
             toEuros.setFont(this.FONT);
             toEuros.addActionListener(new ConvertAction());
             toYen.setFont(this.FONT);
             //toYen.addActionListener(new ConvertAction());
             toRubles.setFont(this.FONT);
             //toRuples.addActionListener(new ConvertAction());
             clear.setFont(this.FONT);
             buttonPanel.add(toEuros);
             buttonPanel.add(toYen);
             buttonPanel.add(toRubles);
             buttonPanel.add(clear);
             this.add(buttonPanel, BorderLayout.WEST);
             // center panel
             int numRows = 4;
             int numCols = 3;
             JPanel middlePanel = new JPanel();
             middlePanel.setLayout(new GridLayout(numRows, numCols, 5, 5));
             middlePanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
             JButton[] buttonArray = new JButton[12];
             for (int i = 0; i < buttonArray.length; i++)
                 buttonArray[i] = new JButton("" + (i+1) );
                 buttonArray.setFont(this.FONT);
    buttonArray[i].addActionListener(new ButtonAction());
    // loop through buttons to mask two spots on side of 0 button
    int next = 0;
    for (int r = 1; r <= numRows; r++)
    for (int c = 1; c <= numCols; c++)
    if (r == 4 && c == 3)
    this.add(new JLabel(""));
    next++;
    else
    middlePanel.add(buttonArray[next]);
    next++;
    buttonArray[9].setVisible(false);
    buttonArray[10].setText("0");
    this.add(middlePanel, BorderLayout.CENTER);
    An action listener that appends a buttons value
    to the end of the dollar amount label
    private class ButtonAction implements ActionListener
    public void actionPerformed(ActionEvent e)
    JButton button = (JButton) e.getSource();
    if(button.getText().equals("0"))
    dollarOutput.setText(dollarOutput.getText() + "0");
    else
    dollarOutput.setText(dollarOutput.getText() + button.getText());
    An action listener that converts the dollar
    value to either euros, yen, or rubles(russian version)
    private class ConvertAction implements ActionListener
    public void actionPerformed(ActionEvent e2)
    int convertedVal = 0;
    Formatter fmt = new Formatter();
    int dollarVal = Integer.parseInt(dollarOutput.getText());
    JButton button = (JButton) e2.getSource();
    if(button.getText().equals("To Euros"))
    fmt.format("%.2f", (dollarVal / 1.4154));
    convertedOutput.setText(String.valueOf(fmt));
    resultsLabel.setText("Euros");
    if(button.getText().equals("To Yen"));
    fmt.format("%.2f", (dollarVal * 116.5));
    convertedOutput.setText(String.valueOf(fmt));
    resultsLabel.setText("Yen");
    if(button.getText().equals("To Rubles"));
    fmt.format("%.2f", (dollarVal * 24.941));
    convertedOutput.setText(String.valueOf(fmt));
    resultsLabel.setText("Rubles");
    // data fields
    public final static Color COLOR_1 = new Color(47, 79, 79);
    public final static Color COLOR_2 = new Color(135, 206, 235);
    public final static Font FONT = new Font("Serif", Font.BOLD, 14);
    private JTextField dollarOutput;
    private JTextField convertedOutput;
    private JLabel resultsLabel;
    would this be the right format for testing which button was clicked? it is how i have been doing in other applications and it has worked
      if(button.getText().equals("To Euros"))
                            fmt.format("%.2f", (dollarVal / 1.4154));
                            convertedOutput.setText(String.valueOf(fmt));
                            resultsLabel.setText("Euros");
                       if(button.getText().equals("To Yen"));
                            fmt.format("%.2f", (dollarVal * 116.5));
                            convertedOutput.setText(String.valueOf(fmt));
                            resultsLabel.setText("Yen");
                       if(button.getText().equals("To Rubles"));
                            fmt.format("%.2f", (dollarVal * 24.941));
                            convertedOutput.setText(String.valueOf(fmt));
                            resultsLabel.setText("Rubles");

    ..but it is still acting wierd
    if(button.getText().equals("To Yen"));//<---remove the semi-colon
    if(button.getText().equals("To Rubles"));//<---remove the semi-colon

  • My iphone 4 had went black and now it wont turn back on i was just texting a second ago now i tried holding down the power button and that didnt work i need help

    my iphone 4 had went black and now it wont turn back on i was jsut texting on it a few mins. ago then when i went to check my texts it was black i tried holding the power button down but that didnt work can someone please help

    Hi alicia243,
    Thanks for visiting Apple Support Communities.
    If your iPhone wont power on, I recommend going through these steps first:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Will not turn on, will not turn on unless connected to power, or unexpected power off
    Verify that the Sleep/Wake button functions. If it does not function, inspect it for signs of damage. If the button is damaged or is not functioning when pressed, seek service.
    Check if a Liquid Contact Indicator (LCI) is activated or there are signs of corrosion. Learn about LCIs and corrosion.
    Connect the iPhone to the iPhone's USB power adapter and let it charge for at least ten minutes.
    After at least 30 minutes, if:
    The home screen appears: The iPhone should be working. Update to the latest version of iOS if necessary. Continue charging it until it is completely charged and you see this battery icon in the upper-right corner of the screen . Then unplug the phone from power. If it immediately turns off, seek service.
    The low-battery image appears, even after the phone has charged for at least 20 minutes: See "iPhone displays the low-battery image and is unresponsive" symptom in this article.
    Something other than the Home screen or Low Battery image appears, continue with this article for further troubleshooting steps.
    If the iPhone did not turn on, reset it while connected to the iPhone USB power adapter.
    If the display turns on, go to step 4.
    If the display remains black, go to next step.
    Connect the iPhone to a computer and open iTunes. If iTunes recognizes the iPhone and indicates that it is in recovery mode, attempt to restore the iPhone. If the iPhone doesn't appear in iTunes or if you have difficulties in restoring the iPhone, see this article for further assistance.
    If restoring the iPhone resolved the issue, go to step 4. If restoring the iPhone did not solve the issue, seek service.
    Best,
    Jeremy

  • I have recently changed networks to giffgaff but now my voicemail button doent work does anyone know how to change the voice mail number so it works again? thanks

    i have recently changed networks to giffgaff but now my voicemail button doent work does anyone know how to change the voice mail number so it works again? thanks

    GiffGaff are not a supported UK Apple carrier .That is probably why you have lost Voicemail they are a cheap carrier who provide minimum services ,do they even offer voice mail
    Go talk to them

  • Button that always works when Unde the Enter key to record the information?

    Hello everyone,
    How do Oracle Express, a button that always works when Unde the Enter key to record the information
    and every time I write some information that the cursor is placed back into the Text Field item only on my screen
    order to optimize this process
    I appreciate your cooperation and attention ...
    good day ...
    Reynel Martinez Salazar

    Hi,
    First, you should change your text item to a "Text Field (Always submits page when Enter press)" item. This adds a call to the submitEnter() javascript function which will submit the page when you press Enter while in the text field.
    Second, on your page, edit the Page definition. In there is a setting called "Cursor Focus" - set this to "First Item on Page". When the page is loaded, this will put the cursor into the text field.
    Andy

  • How to cancel changes in Panels that does not contains a "Cancel button"

    Hi,
    I'm new to Mac, and noted that some dialogs does not contains a "Cancel" Button. Is there some "keyboard combination" that can be used to revert any change made? My main concern is about "Preferences Panels" which can suffer a really mess with unfamiliar users walking there.
    Thanks in advance

    Hi,
    Thanks you both for the advices. I already have used the Command Shift 3 shortcut to 'backup' my settings, just as safety procedure . The Close button instead doesn't cancel the settings changes. It only closes the window. As an example, try to change the 'Currency' field in 'International' Panel, in 'System Preferences'. You will note that it changes, even closing the window. The lock button is my safeguard, and I turned it on in most panels that I saw, but unfortunately it doesn't exists for every panel. I guess must 'take a shot' of the settings, before testing any changes.
    It should be really usefull have a 'Edit / Revert Changes' menu item, for instance.
    By the way, does Time Machine backups System Preferences?
    Thanks for your help

  • HT202159 Mountain Lion upgrade download stopped, now it states in purchased apps that 'an error has occured' and resume button is blank & will not work

    Mountain Lion upgrade download stopped, now it states in purchased apps that 'an error has occured' and resume button is blank & will not work. Tried to re download, but it states code has already been used

    Danielle...
    From the App Store menu bar top of your screen click Store > Check for Unfinished Downloads
    If that doesn't help, disable anti virus software and turn off the Firewall in System Preferences > Security & Privacy.
    Keep in mind, for downloading Mountain Lion from the App Store, a high speed (broadband) internet connection is strongly recommended by Apple as noted here > iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
    If you need to reinstall OS X or repair the the startup disk using Mountain Lion Recovery, that requires broadband (high speed internet) access to the internet via Wi-Fi or an Ethernet connection. OS X is downloaded over the internet form Apple when OS X Recovery is used for reinstallation.

  • My iphone 5 suddenly turned itself off and 48 hrs later it still wont charge or turn on. i've tried the home and sleep button technique and its still dead also i've tried the usb into my computer and tried to reset it through itunes that didnt work either

    iphone 5 turned off 48 hours ago it wont charge and it wont turn on. i've tried the sleep/home button method that didnt work nothing came up on the screen and also tried usb into computer and doing it through itunes that still hasnt worked my phone is completely lifeless! is there anything else i can possibly do before i have to go into the shop?

    Hi jscheilling,
    Welcome to the Support Communities!
    The article below may be able to help you with this issue.
    Click on the link to see more details and screenshots. 
    iPhone, iPad or iPod touch: Not responding or does not turn on
    http://support.apple.com/kb/TS3281?viewlocale=en_US
    Cheers,
    Judy

  • My iphone 4 randomly froze while i was face timing and now its just a black screen with thin grey lines on it. it wount turn on even if i press the lockscreen or home screen button. ive tried chargingit but that wont work either.

    my iphone 4 randomly froze while i was face timing and now its just a black screen with thin grey lines on it. it wount turn on even if i press the lockscreen or home screen button. ive tried chargingit but that wont work either. It's been like this for about two hours now.

    Hold down the Home and Power button for 20 seconds. And try to update again.
    Also read and follow this:
    http://www.apple.com/support/iphone/assistant/restore/

  • My ipod will not charge or turn on or show any sign and its not jailbroken and i tried holding the home and power button and all that stuff but nothing works please helppppppp

    my ipod will not charge or turn on or show any sign and its not jailbroken and i tried holding the home and power button and all that stuff but nothing works please helppppppp

    Go through the steps here and see if anything works for you.
    iOS: Not responding or does not turn on - Apple Support
    You might have to bite the bullet and restore the device if nothing else works. If that doesn't bring it back to life, make an appointment at an Apple Store and let take a look at it.

  • My i-phone won't turn on, it went off all of a sudden even though the battery was half charged and wont turn back on, I've tried holding the home and power buttons but that hasnt worked, can anyone help?

    My i-phone wont turn on and I don't know why, it went off all of a sudden even thought the battery was half charged, I've tried holding the power and home buttons to reset it but that hasnt worked, I don't know what else to try, can anyone help?

    Charge it for 30 minutes with the wall charger, then hold the HOME and SLEEP buttons at the same time for up to 30 seconds. If nothing happens your phone is probably broken.

  • Need help converting this html code into code that will work as a flash button

    I have some html code that is for a button in html that when
    pressed sends you to a certain url but also somehow adds an 'id
    value' and a 'website value'.
    How can I convert this code and or put it into a flash
    button?
    Disregard the gif info...that's just for the html graphic
    that goes for the button.
    [HTML]<form
    action="https://secure.verotel.com/cgi-bin/vtjp.pl"
    method="post">
    <input type=hidden name=verotel_id
    value="9804000000840231">
    <input type=hidden name=verotel_website value="55461">
    <center>
    <input type="image" src="
    http://buttons.verotel.com/join/button_00010155461.gif"
    alt="Signup NOW!">
    <img src="
    http://buttons.verotel.com/signup/tbutton_55461.gif"
    border="0" width="1" height="1" alt="">
    </center>
    </form>[/HTML]

    What you want to do might look something like this:

  • Remote panel doesn't work

    I am using 2011 SP1 version of LabVIEW, toolkits and add-ons. I am trying to make the following remote panel opening VI work.
    This used to work well on LabVIEW 8.5 but now I get an Error 7 from the last Invoke Node of the second loop. The top loop works fine. HPAC Main.vi is running as a startup VI on the RT target (PXI-8106). I can open its front panel using this VI. But the second loop can't open ST_viewer 1.vi. File names and paths are all correct. For building HPAC.rtexe, on the Source Files tab, HPAC Main.vi was chosen as a startup VI while ST_viewer 1.vi was put in the Always Included box. The VI server of the PXI is using TCP/IP port 3363. The PXI is directly connected to this host PC by an Ethernet cable.
    I also made a very simple project (attached file named ServerTest), deployed its rtext to the PXI and ran it as startup. After rebooting, I tried to open the remote front panel of main.vi and sub.vi on the PXI using access.vi. I get the following errors at the Invoke Nodes.
    For trying to open main.vi > Error 1352: Requested VI is not loaded into memory on the Server Computer
    Fro trying to open sub.vi > Error 7: File not found......
    As suggested in the article, Real-Time System Manager seems useful but I can't find it. Tools > Real-Time Module > and then I can't find the system manager. I only see Project Wizard, Configure Time-triggered Network and Execution Trace Toolkit. Does 2011 version have something else?
    Any help will be appreciated!
    Attachments:
    HPAC Executable.vi ‏33 KB
    ServerTest.zip ‏215 KB

    Thank you, JaymeW. I found the VI States tab in the Distributed System Manager. And yes, all the steps in that article were already done.
    If I set sub.vi as a startup VI on the PXI along with main.vi, then I can open it using the same method that opens main.vi. However, if I put sub.vi in Always Included box on Source Files tab and use the VI server to open it, I get errors.
    On the VI States monitor, I see main.vi running as a startup VI on top level when I turn on the PXI. Then, I run access.vi and open main.vi successfully. When I click the sub.vi open button, sub.vi appears on the monitor with Run Top Level status but I get error messages.
    At the first attempt to call the remote front panel of sub.vi, I get:
    LabVIEW: Resource not found.
    An error occurred loading VI 'lvfpp0.vi'.
    LabVIEW load error code 3: Could not load front panel.
    From the second call, I get:
    Error 1000 occured at Invoke Node in access.vi
    Possible reason(s):
    LabVIEW: The VI is not in a state compatible with this operation.
    Method Name: Run VI.
    Could you take a look at the attached simple project and suggest a solution? Thank you!
    Attachments:
    ServerTest2.zip ‏218 KB

  • Adobe Exchange Panel Update not working?

    Hello:
    My OS is Windows 7 64 bit and I have Ps and Ia installed on my laptop.
    I downloaded and installed the Adobe Exchange roughly two months ago and everything worked great at first.
    I installed a few things such as the Paper Textures and a game Level Up (can't recall the others at the moment).
    The game worked three times but then it just stopped responding. I never had an issue with the other extensions.
    Yesterday I went to try out the game again but when i opened the Exchange panel it said there was a new update and so i (sadly) opted to click 'Update'
    After clicking the update button I received a message:
    Also, Norton said the link or what have ya was NOT trusted and is Unknown. So, I clicked on the Norton message and got this info:
    Heuristic virus? um, what?  
    http://www.pctools.com/security-news/heuristic-virus-definition/
    I went ahead and Removed all the extensions I had downloaded/installed from the Exchange panel but I would very much like to be able to use them again.
    Any ideas as to the issue? Is there a solution?
    I have shut off Norton to see if that would work but I still get the above message  "... valid signature ... "
    Sure would appreciate some input.
    Thank you in advance
    ps. could the Heuristic virus detection be a False Positive?

    Hello:
     You are totally misunderstanding me. I have Windows 7 64 bit and I did have the Exchange Panel already installed. When I went to use the Exchange PanelIT had an update. I didNOT update to Windows 8.
    I clicked on the UPDATE IN the Exchange Panel which is what would NOT install because NORTON said it IS MALWARE.
    I tried to update the Exchange Panel and NOT my operating system.
    The attempt to Update the Exchange Panel caused the older version of the Exchange Panel to not work. So, I had to Uninstall the Exchange Panel and then when I went to Reinstall the Exchange Panel it would NOT install. And now I cannot use it at all.
    Again, I DO have Windows 7 and NOT Windows 8.
    Please, I would very much like to be able to use the Exchange Panel again because I would like to install some extensions, let me know when this issue is resolved.
    Thank You,
    Kara A. Rowe
    [email protected]

  • Update Panel is not working browsers other than IE

    In SharePoint 2013, Update Panel is not working for firefox, chrome etc.

    Hi,
    From your description, my understanding is that you use
    <asp:UpdatePanel>tag in your code, but it does not work well in browsers except
    IE.
    I have test
    <asp:UpdatePanel>tag with code below, and it works well in IE, chrome, Firefox
    as the screenshot.
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
    <ContentTemplate>
    <asp:Label ID="lbl" runat="server" Text="Loaded" Visible="true"></asp:Label>
    <asp:Button ID="btn" runat="server" OnClick="btn_Click"/>
    </ContentTemplate>
    </asp:UpdatePanel>
    protected void btn_Click(object sender, EventArgs e)
    lbl.Text = "BUTTON CLICKED !";
    lbl.Visible = true;
    The screenshot below is my result(the first is result in Chrome, second is in Firefox and last is in IE):
    And you also could refer to this article:
    http://sharepoint.stackexchange.com/questions/72928/update-panel-not-working-in-firefox-2013
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for