Why id this not working? Please Help...

This part in my action performed is not working. the buttons on my second form is not responding at all!!! Please help ...
     public void actionPerformed(ActionEvent ae)
          if(ae.getSource() == itmAddD)
               frmAddDriver.setVisible(true);
               String name;
               String surname;
               String work;
               int age = 0;
               if(ae.getSource() == btnAddAD)
               if(!((txtAgeAD.getText().equals("")) && (txtSurnameAD.getText().equals("")) && (txtNameAD.getText().equals(""))))
                         name = txtNameAD.getText();
                         surname = txtSurnameAD.getText();
                         try
                              age = Integer.parseInt(txtAgeAD.getText());
                              addDriver.add(new MyDriver(name, surname, age, cboWorkAD.getSelectedItem()));
                              cboDriver.addItem(name);
                              for(int i = 0; i < addDriver.size(); i++)
                                   System.out.println(addDriver.elementAt(i));
                         catch(NumberFormatException err)
                              JOptionPane.showMessageDialog(frmMyGUI, "Age should be numeric","Error", JOptionPane.ERROR_MESSAGE);
               else if(ae.getSource() == btnCancelAD)
                    frmMyGUI.dispose();

You're a crazy maniac. The reason none of your buttons (bar one) are working is because you nested all the if statements....
if(ae.getSource() == itmAddD)
    if(ae.getSource() == btnAddAD)
        // how is this ever going to be true?Un-nest them.
Cheers,
Radish21

Similar Messages

  • I cant see why it is not working please help

    Hello all,
    I am practicing JSP by developing a site of my own.. I have come across a problem that I could not figure out.. I will appreciate all your hints please.. If I am posting this question in a wrong forum please be kind enough to route me to an appropriate forum please.
    I have a JSP that works fine in Firefox but will not load on any other browsers...like IE 8, Chrome, Safari
    I do not know if it is a problem with JSP or not I will greatly appreciate your input please. I stick the code below
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    <%@ page language="Java"%> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>joblet.lk</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="styles.css" />
    <script language="javascript" src="/test/DisableRightClick.js"></script>
    <script language="javascript" src="/test/newPopWindow.js"></script>
    <link rel="shortcut icon" href="/test/Images/favicon.gif">
    </head>
    <body bgcolor='#ffffdc'>
    <!-- Begin Wrapper -->
    <div id="wrapper">
    <!-- Begin Header -->
      <!--div id="header"><h1><a href="http://www.test/index.html">test</a></h1></div-->
      <div id="header">
      <!--p class="header">test</p-->
              <div id='logo'><img src="/test/Images/test.jpg"></div>            
              <div id="banner">
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
          codebase="http://download.macromedia.com/pub/shockwave/cabs
                    /flash/swflash.cab#version=6,0,29,0"
            width="475" height="81">
          <param name="quality" value="high">
          <embed src="myFlashMovie.SWF" quality="high" pluginspage=
           "http://www.macromedia.com/go/getflashplayer"
              type="application/x-shockwave-flash" width="475"
                       height="81">
          </embed>
        </object>
              </div>
    <div id='time'>
    <script>
    var mydate=new Date()
    var year=mydate.getYear()
    if (year < 1000)
    year+=1900
    var day=mydate.getDay()
    var month=mydate.getMonth()
    var daym=mydate.getDate()
    if (daym<10)
    daym="0"+daym
    var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
    var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
    document.write("<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font></small>")
    </script>
    </div>
      </div>
      <!-- End Header -->
      <!-- Begin Navigation -->
      <div id="navitop"> </div>
      <!-- End Navigation -->
      <!-- Begin Navigation -->
      <div id="navigation">
          <div class="rollover"><a href="/test/">Home</a></div> 
             <div class="rollover"><a href="/test/servlet/jController?empid='12345610'">Recruit</a></div>
          <div class="rollover"><a href="#">History</a></div>
          <div class="rollover"><a href="#">Location</a></div> 
             <div class="rollover"><a href="#">FAQ</a></div>
          <div class="rollover"><a href="#">Contact</a></div>
    </div>
      <!-- End Navigation -->
    <!--Check if list available in the session else route to the index.jsp  -- >
         <script>
         function doit(){
         window.print()
         </script>
         <script>
         function didit(){
         window.close()
         </script>
    <%
    if (session.getAttribute("validEmployer")==null)
    {%>
    <form method="post" action="/test/recauthentication.jsp">
    <div><span id ='count1'> <a href="reclogin.jsp">    logout</a></span> </div>
    <div id='content_small'>
    <table border = '0'>
    <tr>
    <td align = right width = '15%'></td>
    <td align = left><h5>Authentication</h5></td>
    </tr>
    <tr>
    <td align = right width = '15%'>e-mail:</td>
    <td align = left width = '20%'>
    <input type=text name="email"><br>                                                             
    </td>
    </tr>
    <tr>                                        
    <td align = right width = '15%'>password:</td>
    <td align = left width = '20%'>
    <input type=password name="password"><br><p>
    </td>                                                           
    </tr>
    <tr>
    <td align = right width = '15%'><span id ='count1'>. </span><br><p></td>
    <td align = left width = '20%'>${fn:escapeXml(param.errorMsg)}
    <br><p></td>
    </tr>
    <tr>
    <td align = right width = '15%'></td>
    <td align = left width = '20%'>
    <input type="submit" value="Login">
    </form>
    <a href=JavaScript:newPopWindow('../test/recregister.jsp',470,310,'c');window.close();><span id='count'>  Not Registered ?</span></a>
    </td>
    </tr>
    </table>
    </div>
         <%}
    else      {
    response.sendRedirect("/test/recruiter.jsp");
    %>
    </div>
    <!-- End Wrapper -->
    </body>
    </html> A Million Thanks in Advance

    Too much code to review in depth.
    Couple of things that jumped out at me
    1 - request.sendRedirect sent at the end. You should do any request forward/redirects as soon as possible in the jsp - before your response gets committed. It is illegal to forward/redirect after a response has been committed. That might explain the errors.
    2 - As a suggestion, view source on the page, and save the file as html. Or use the functionality to "save a webpage" to your local computer. Try loading that HTML page in all the browsers. That should help you diagnose is it the HTML code, or is it the JSP side of things that is broken.
    hope this helps,
    evnafets

  • I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

  • HT4623 iOS 6.1 no longer available because you are no longer connected to the internet- this is what my iphone 4 shows. iv tried switching off again and again, closing apps by double tapping the home button but still not working. please help.

    this is what my iphone 4 shows. iv tried switching off again and again, closing apps by double tapping the home button but still not working. please help.
    is there any other method to download ios 6.1.2.
    my phone is not being recognized by itunes on my new windows 8. neither its working on touch copy.
    kindly help.
    thanks

    well in thatcase, i need another help .
    thanks for your instant reply.
    i have currently bought a new laptop (windows 8) and my iphone is not being recognized by itunes.
    because i have no backup on my previous laptop, i downloaded touchcopy but even touch copy is not recognizing my iphone.

  • The built-in mic in g50 122ca laptop model is not working. please help me out.

    the built-in mic in g50 122ca laptop model is not working. please help me out. OS: Windows Vista (32-bit)

    here is a sample code .
    so far you procedure looks good but
    i bet you have to specify the name of report , instead of 'filename'.
    see this
    Plist_id := GET_PARAMETER_LIST('P_name');
    IF NOT ID_NULL(Plist_id) THEN
    DESTROY_PARAMETER_LIST(Plist_id);
    END IF;
    Plist_id := CREATE_PARAMETER_LIST('P_name');
    ADD_PARAMETER( Plist_id, 'P_Receive_date', TEXT_PARAMETER, TO_CHAR(Receive_date,'mm/dd/yyyy'));
    ADD_PARAMETER( Plist_id, 'P_Hearing_date', TEXT_PARAMETER, TO_CHAR(Hearing_date,'mm/dd/yyyy'));
    ADD_PARAMETER( Plist_id, 'P_Hearing_time', TEXT_PARAMETER, TO_CHAR(Hearing_time,'mm/dd/yyyy'));
    ADD_PARAMETER( Plist_id, 'P_Issue_date', TEXT_PARAMETER, TO_CHAR(Issue_date,'mm/dd/yyyy'));
    ADD_PARAMETER( Plist_id, 'P_Workshop_date', TEXT_PARAMETER, TO_CHAR(Workshop_date,'mm/dd/yyyy'));
    -- RUN_PRODCT(REPORTS,'..\Reports\Pro_License',SYNCHRONOUS, RUNTIME, FILESYSTEM, Plist_id, NULL);
    -- here Pro_License is the name of report.
    did you tried to see if the parameter passed using a message ?
    try
    message('parameter name'); pause; write this before "run_report".

  • The click at touchpad is not working, please help!!!

    I use Macpro, recently the click at touchpad is not working, please help!!! Thank you !!

    For this issue AppleCare support told me to so a SMC reset as follows:
    Power the machine OFF.
    At the SAME TIME hold down the following buttons:
    Shift
    Control
    Option
    Power
    Then release all buttons.  Power up the Macbook and see if the trackpad button work.
    Hope this helps.
    Bill

  • My ipad mini and iphone 4s are not connecting over bluetooth. iphone cannot locate ipad mini or says it is not supported. It used to work perfectly but now its not working. please help.

    my ipad mini and iphone 4s are not connecting over bluetooth. iphone cannot locate ipad mini or says it is not supported. It used to work perfectly but now its not working. please help.

    Hi
    Thanks for the support but I had already tried this . Again did it as you advised. Still not able to connect the ipad mini with Bluetooth.
    Could it be that some app is causing issue. I can connect my car and computer over Bluetooth but not ipad mini.
    On the other had ipad is connecting to other iPhone but only not mine.
    Still showing ipad not supported message. And also shows not paired.
    Please help.

  • Hey, I wanna download Lion for free, so i need UP-TO-DATE , but it do not works , please help

    Hey, I wanna download Lion for free, so i need UP-TO-DATE , but it do not works , please help

    I think you misunderstood the guy. The up-to-date program isn't working for a lot of people. I'm eligible for the free upgrade but it fails to recognise my serial. From what I've read, this is affecting a lot of people who purchased their computers online. Apple seems to be fixing the issue though, so my advice would be to keep trying. Alternatively, click on the manual verificaton link so they can check your order for you and send the redemption code after they do.

  • Hi , i have iphone 4s , wifi not working please help me

    hi , i have iphone 4s , wifi not working please help me

    Read this article: http://support.apple.com/kb/TS1398

  • HT201412 my iphone 4s does not start by power switch, it starts when i connect to pc. the proximity sensor is not working. please help

    my iphone 4s does not start by power switch, it starts when i connect to pc. the proximity sensor is not working. please help.

    Sounds like it may be a hardware issue.
    Please contact Apple Support in your country.
    Here is a list of numbers: http://support.apple.com/kb/HE57
    Regards
    J

  • I have 4s iPhone , I download the iOS 7. Now the front receiver microphone is not working , please help me that how to fix the problem.

    I have 4s iPhone , I download the iOS 7. Now the front receiver microphone is not working , please help me that how to fix the problem.

    I live in South Africa, and I had the same problem with my iPhone 4.
    After weeks of frustration and swearing, I was in the process of restoring my phone to a previous iOS. To do that you need to turn the "Find my iPhone" option off, since i turned it off, my problem was solved. No need to repair anything or revert back to old iOS.
    ***** that i cant use Find my iPhone, but atleast i can use my phone.

  • I installed windows 7 on my macbook pro. all is working but lan adaptor and sound od laptop is not working. please help me or send the link where i can download the these drivers.

    I installed windows 7 on my macbook pro. all is working but lan adaptor and sound od laptop is not working. please help me or send the link where i can download the these drivers.I have lost my resource cd .

    If you are running Lion or Mountain Lion, the drivers are downloaded from within Bootcamp Assistant. If you are running Snow Leopard the drivers are on your Snow Leopard install disk.
    Read the Bootcamp Install Guide for your version of OSx. http://www.apple.com/support/bootcamp/
    Bootcamp questions should be asked in the Bootcamp forum where the Bootcamp gurus hang out https://discussions.apple.com/community/windows_software/boot_camp

  • HT202853 I have many project made in move HD that are not updating to the new iMovie 10 on my new iMac.  Why is this not working as stated?  How do I get my projects back from backup after old iMac crashed?

    I have many projects made in imovie HD that are not updating to iMovie 10 on my new iMac.  Why is this not working as stated on the article HT202853?  How do I get my projects back from backup after old iMac crashed?

    According to:
    Update projects and events from previous versions of iMovie in iMovie (2014) - Apple Support
    you can update from iMovie versions 7, 8 and 9, but iMovie HD is iMovie 6.
    Maybe you can update in two steps, first from iMovie 6 to iMovie 7, 8 or 9 then to iMovie 10. 
    Geoff.

  • While updating 4.0 version to 5 version system shows sim card is not valid. My iphone is not working .Please help me

    while updating 4.0 version to 5 version system shows sim card is not valid. My iphone is not working .Please help me

    I would imagine your iPhone was hacked to make it work on your local carrier.
    Updating the iOs to 5.xx will lock it back to the original carrier .The carrier holding the lock are the only
    entity able to authorise the unlock .You will have to contact them and see if they unlock and the terms the apply

  • HT1414 my handsfree is not working please help me

    Hi There!
    I am using Iphone 4s and ny handsfree in not working please help me

    Try restarting you iPhone by holding down the on/off and the home buttons at the same time until you see the Apple logo. 

  • HT201320 I have ne iphone 5, i been setting my email using AT&T global but it is not working, please help me on the correct configuration

    I have ne iphone 5, i been setting my email using AT&T global but it is not working, please help me on the correct configuration

    Contact the email provider and obtain the correct setup information.

Maybe you are looking for

  • Officejet K550 Pro: Paper Feed Problems

    About a year or two ago, we purchased a K550 unit for our office, and 3 subsequent units for employees' personal use.  At first, everything went great - it was the best inkjet printer I or my staff had ever owned!  After a month of great service, my

  • Data Class in ABAP dictionary

    hi,    recently we moved the tables from tablespace PSAPBTAD to user defined tablespace & since than we have poor performance in PROD - have any one had this issue before ? any idea on data class and tablespace ? thanks

  • SMS in Yosemite messages not working. "Not registered with iMessage"

    Just updated today to Yosemite. Macbook Pro 2013 (current retail model) with upgraded RAM and flash storage. iPhone 6 running 8.0.2 with recent back up to iCloud. When sending iMessages to my normal iMessage contacts, everything is ok. This update sh

  • Which table is better? BSEG or BSIS,BSAK or BSIK

    Hi, i want to know whihc table is better for the reterival of data for whether the payment of vendor is done or not? Which table should i use for the reterival of data? BSEG or BSIK,BSAK n BSIS. I am asking bcoz BSEG is cluster table and it will cona

  • About  reports distibution in 10g reports.

    Hi, I have to generate multiple reports in to multiple formats(html,pdf,printer). Do I have to create mutilple distributions files(dest1.xml,dest2.xml..etc)?. I developed these reports in 10g(paper layout). Is it possible to get an example?