I've got some kind of issue with removing an ActionListener

public class JTextNameListener implements ActionListener
    public void actionPerformed(ActionEvent e)
      //if (buttonEnabled == true)
        passengers[currentButton-1] = jTextName.getText();
        jTextName.setEditable(false);
        jTextSeatNumber.setText(Integer.toString(currentButton));
        if (currentButton == 2)
          btnSeatTwo.removeActionListener(ButtonChoiceListener);
          btnSeatTwo.removeActionListener(ButtonEnableListener);
          btnSeatTwo.setForeground(Color.black);
        else if (currentButton == 5)
          btnSeatFive.removeActionListener(ButtonChoiceListener);
          btnSeatFive.removeActionListener(ButtonEnableListener);
          btnSeatFive.setForeground(Color.black);
        }Here is the segment of code that is not functioning properly...and i'm a bit confused.
The entire program is working except when I hit enter for this JTextField...it does not remove the listeners off of the Buttons. I declared these up top as private fields and then I added the listeners by doing this...
add(btnSeatFive);
    btnSeatFive.setForeground(Color.GREEN);
    btnSeatFive.addActionListener(new ButtonEnableListener());
    btnSeatFive.addActionListener(new ButtonChoiceListener());
    add(btnSeatSeven);
    add(btnSeatNine);
    add(btnSeatEleven);
    btnSeatEleven.setForeground(Color.GREEN);
    btnSeatEleven.addActionListener(new ButtonEnableListener());
    btnSeatEleven.addActionListener(new ButtonChoiceListener());
    add(btnSeatTwo);
    btnSeatTwo.setForeground(Color.GREEN);
    btnSeatTwo.addActionListener(new ButtonEnableListener());
    btnSeatTwo.addActionListener(new ButtonChoiceListener());
    add(btnSeatFour);
    add(btnSeatSix);
    btnSeatSix.setForeground(Color.GREEN);
    btnSeatSix.addActionListener(new ButtonEnableListener());
    btnSeatSix.addActionListener(new ButtonChoiceListener());
    add(btnSeatEight);
    add(btnSeatTen);
    add(btnSeatTwelve);

alright thank you very much! I ended up having to do this for some reason...but works perfectly...
private ButtonEnableListener enableListener = new ButtonEnableListener();
  private ButtonChoiceListener choiceListener = new ButtonChoiceListener();
if (currentButton == 2)
          btnSeatTwo.removeActionListener(choiceListener);
          btnSeatTwo.removeActionListener((ActionListener) enableListener);
          btnSeatTwo.setForeground(Color.black);
        else if (currentButton == 5)
          btnSeatFive.removeActionListener(choiceListener);
          btnSeatFive.removeActionListener((ActionListener) enableListener);
          btnSeatFive.setForeground(Color.black);
        }I don't understand why I had to cast the enable listener but eclipse told me to do it and it worked so...Still if anyone knows why I had to do that, that would be helpful.

Similar Messages

  • I've got a death grip issue withe my new iphone 4s 16GB.

    I've got a death grip issue withe my new iphone 4s 16GB. When I touch lower left corner of the device signal goes down and NO SERVIS pops up. When I do not touch this part of device everything is fine.
    I am from Slovakia.
    I have unlocked device and using T-mobil / Telekom carrier.
    Please help me slove this problem. Thank you for any advice / response.

    get a case.  That's the solution.  Simple.

  • Hi All, can i have some production support issues with rootcasue and resolution for SAP TM?

    Hi All, can i have some production support issues with rootcasue and resolution for SAP TM?
    Thanks,
    Sreenivas

    Hi Sreenivas,
    I would recommend that you read the Rules of Engagement and other documents in the Getting Started link (top right) before posting anymore.  Your Discussion will most likely get reported as non-specific and get removed.  If you have a specific problem with TM, please post it in a new thread with error messages, version and SPs installed, and how the error occurs and what you are trying to get TM to do.
    There are a lot of resources available in the TM Overview page which can help, so start there and maybe also look at some of the MKS (Monday Knowledge Session) recordings which should also be listed.  There are also a lot of experienced people who can help resolve issues your TM installation, but you need to provide enough information on the problems you are having.  If you are just looking for information on past problems, do a Search or simply browse through past Discussions which are marked with a green Check (Correct Answer).
    Regards, Mike
    SAP Customer Experience Group - CEG (and a Moderator)

  • Issue with Removing the Patch Set Software 9.2.0.8

    Hi experts,
    I have issue with removing the patch set software 9.2.0.8
    I'm working on solaris box recently ugraded to 9.2.0.8 from 9.2.0.7. however i want to downgrade now. I have followed the document 4547809 mentioned. Now the real issue is when i restored the oracle_home (9.2.0.7) and execute sqlplus /nolog here is error message shown
    bash-2.05$ sqlplus /nolog
    bash: /oracle/test/920_64/bin/sqlplus: No such file or directory
    bash-2.05$ lsnrctl
    bash: /oracle/test/920_64/bin/lsnrctl: No such file or directory
    Please help
    thanks in advance

    Hi,
    Thanks for reply you are right
    ls -l /oracle/test/920_64/bin/sqlplus was not exist. However i copied everything from the backup.
    I'm trying again
    cp -r bk_test_home/* /oracle/test/920_64/*
    still i couldn't the file however it exist in bk_test_home. please suggest
    Thanks and regards

  • Some very weird issue with Motion tween

    Hello, guys! I confronted some kind of weird problem. I uploaded it in fla, https://www.dropbox.com/s/u9bkjiokk51m1o3/landscape_START.fla. Soo, about the problem, flowers in layers 8,9,10 act wrong, when im trying to apply motion tween, they move from their current position right to the hell another one, and i can't understand why. Can somebody explain me what the matter? Because the  rest of objects in another layers make it right, when i use motion tween. Oh, and btw, when you make zoom like 50% and less, u can see the workplace consist of gray square in dark gray square, again, wtf? When i make sizes in properties panel larger, it just goes crazy.

    Emm, i meant that you should make motion tween by yourself to see that problem with flowers on layers 8,9,10. You just selecting any frame you want, then applying motion tween on flower on layer 8,9 or 10 and then puff, its like screwed up. Well, i tried to copy and replace this flower movie clips, but its always the same. For example, the rest of objects, when you apply motion tween on em, dont changing their location...

  • I have set up payment method on i tunes as pal pal but when i try to make the payment it comes back declined,there is no issue on pay pal card it is some kind of glithch with i tunes.I want to use my pal pal account as my primary means of payment but your

    I have successfully created a payment account on I tunes through my pay pay account,however when I attempt to submit the payment,It shows declined.There is not a problem with my pay pal account the problem is with I tunes. can you please help me resolve this issue so I can pay on the account.I want pay pal to be my primary means of payment to I tunes thank you, billpeterfromyubacity

    Hi,
    Troubleshooting a start up script can be difficult. There are some third party programs that also keep logs of start up programs, however for Firefox this may be different.
    Is Firefox a startup program? [http://www.winxptutor.com/msinfo32.htm]
    Its also possible to check the Web developer tools for any scripts in a page: [https://developer.mozilla.org/en-US/docs/Tools/Debugger]
    In the control panel there is also Administrative tools to view event logs, but this may be something a local technician can walk you through.

  • Cannot install Firefox. WHen I click on the link to install, it takes me to an "error loading page" notice. My network connection and internet access are normal with Internet Explorer, so this is not the issue. Some kind of conflict with my settings or pe

    Cannot install Firefox. When I click on the link on the Mozilla website, it goes to an "error loading page". My network connection and Internet Explorer are fuctioning normally.
    == computer was recently wiped clean and am now reinstalling all previous software and applications ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

    None of the stuff in " http://kb.mozillazine.org/Locked_or_damaged_places.sqlite " helps. I have tried and tried and I have even wipe the computer clean still didn't help. I got the same problem as he/she has got in the first posted. Can add some web pages but not all the web pages I want.. I should have never updated to 3.6.13... That's when it all started for me, from that version..... Now Version 3.6.14 is out, I was hoping the version 3.6.14 might would fix the problem wrong again....
    Funny thing is i can not even Bookmark Firefox.com!!!!!...lol
    So any ideas on how to fix it other than the link giving would help.
    Thanks.

  • I've been using Firefox for some time now. but i've been having all kind of issues with it and am considering a move to Google Chrome. i don't want to do this, but for example: your site tells me i'm running version 3.6.10, when i am running 4.0.1...huh?

    i play restaurant city on Facebook, among other things, but the game crashed every time i breathed on it. somebody suggested Chrome, so i switched to it...just for that game.
    today, i started having trouble with Twitter (the new one), sending messages & tweets. i've switched to the old one & it works, but again suggested that i go to Chrome for this & all my needs.
    i don't want to, but i will if things like this keep happening.

    You can use the Tab key to select a search engine on the bottom bar and press Enter to use the search engine to do the search.
    *https://support.mozilla.org/kb/Search+bar
    In the current Firefox 34 release there is a new "one-off" search bar.
    This search bar doesn't show the name of the search engine and a logo.
    You can type one letter to make a drop-down list appear where you can see suggestions and see the used search engine and that also has bar at the bottom where you can select other search engines that are enabled via the Search tab in Options/Preferences.
    You can use the Tab key to select one of the other available search engines and press the Enter key to search with the selected search engine.
    Click the search engine icon and click "Change Search Settings" to open the Search tab in Options/Preferences (positioned between Tabs and Content) to select the default search engine and select which search engines to show in the search bar drop-down list that opens when you start typing search terms.

  • I got some kind of error message and I don't know what to do with it.

    html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en' xmlns:fb='http://www.facebook.com/2008/fbml' >
    <HEAD>
    <TITLE>Congratulations!</TITLE>
    <STYLE TYPE="text/css">
    .friendly
    display: none;
    .original
    display: block;
    </STYLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF">
    <CENTER>
    <BR>
    <TABLE BGCOLOR=#FFCC00 BORDER=0 CELLPADDING=1 CELLSPACING=0>
    <TR>
    <TD>
    <TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0 WIDTH=100%>
    <TR BGCOLOR=#CC0000>
    <TD ALIGN=center>
    <FONT COLOR=FFFFFF FACE=verdana,sans-serif SIZE=+3><B>You're almost done!</B></FONT>
    </TD>
    </TR>
    <TR BGCOLOR=#FFFFFF>
    <TD ALIGN=center>
    <BR>
    <FONT FACE=verdana,sans-serif SIZE=-1><B>
    Please take a few moments to respond to our Special Survey below. You Must Keep Going To Qualify For Your Gift!<P><B>Tip</B>: Check "Yes" to get great FREE STUFF & Special Deals - As Many as You Wish!<P></FONT>
    <BR><BR>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>
    <BR>
    <BR>
    <BR>
    <TABLE BORDER=0 WIDTH=580>
    <TR>
    <TD ALIGN=center>
    <FONT FACE=verdana,sans-serif SIZE=-2>
    You must be 13 years or older.
    <P>
    <A HREF="info.htm?tp=privacy&SID=e7dj34i4uuq5p5rkjpefnu6g26" TARGET=_blank onClick="make_x_win=0;">Privacy Policy</A> | <A HREF="info.htm?tp=tos&SID=e7dj34i4uuq5p5rkjpefnu6g26#gift" TARGET=_blank onClick="make_x_win=0;">Terms & Conditions</A>
    <BR>
    Copyright © 2005 Clipngocoupons. All rights reserved.
    </FONT>
    </TD>
    </TR>
    </TABLE>
    </CENTER>
    <!-- - - -->
    <SCRIPT>
    if(document.getElementById('processing')) { document.getElementById('processing').style.display = 'none'; }
    if(document.getElementById('submit')) { document.getElementById('submit').style.display = 'none'; }
    </SCRIPT><IMG BORDER=0 HEIGHT=1 WIDTH=1 SRC="http://www.theuseful.com/setcookie.htm?user_pin_id=207945910&pin_key=216256&email=[email protected]&email_key=e24a56a59cd7525fcf0c4b9ad62d71dc"> </BODY>
    </HTML>

    I'm guessing you did not buy the iPad from Apple. If you did not buy it from Apple, it may very well have an older software version. Only iOS 5 or later is PC independent. If you have an earlier version, a computer with iTunes loaded is required.
     Merry Christmas

  • Some recurring failure issues with Win 7 OSD/ZTI during multiple device deployment

    I'm currently working on a project to get rid of XP with Windows 7 ZTI using local hard link USMT. Everything is going well for the most part but I have two issues that keep coming up on a few machines.
    These are my stats so far:
    580 successful with no issue
    27 devices USMT loadstate errors (data is intact in C:\UserState however loadstate failed and did not complete the restore or deletion of that folder as it should:
    4-5 failure during OS apply .wim step (system is no longer bootable however data is intact in C:\UserState)
    A very few machines fail during the Apply OS step. On one machine since I was in front of it I saw this device had some bad sectors on the drive. I manually ran chkdsk to fix the errors and then reimaged it fine.
    Since we are doing ZTI remotely we aren't in front of the device to confirm for the other 4-5 this was the same issue on them. I have built in a second attempt to apply the OS with it running chkdsk during the task sequence if it failed on the first attempt.
    So far this isn't working to get around the problem on some machines.
    This is the command line I'm using from WinPE if Apply OS fails the first attempt:
    cmd.exe /c "x:\windows\system32\chkdsk c: /F /R"
    If it fails in WinPE I don't have the smsts.log details since we are remote at that time.
    Does anyone have any further suggestions on this issue?
    Second problem that I see a few every night for example if I deploy to 70 devices I will likely see about 2 with this problem. USMT loadstate failure after OS is applied. The data is intact but not restored all the way. I then have to get a tech to visit
    the device, confirm data restoration and then cleanup the C:\UserState folder.
    These are some of the common errors from LoadState.log:
    2014-02-28 00:47:25, Error                 [0x080000] There was an error while calling CreateProfile. Error: 0x800700B7
    2014-02-28 00:47:25, Info                  [0x0803e5] Not unmapping HKCU; it is not mapped
    2014-02-28 00:47:25, Error                 [0x000000] Error 0 creating profile for user MyDomain\JamesT (source user MyDomain\JamesT)
    2014-02-28 00:47:25, Info                  [0x000000] Failed.[gle=0x00000006]
    2014-02-28 00:47:25, Info                  [0x000000]   A Windows Win32 API error occurred
       Windows error 0 description: The operation completed successfully.[gle=0x00000006]
    2014-02-28 00:47:25, Info                  [0x000000] Entering MigCloseCurrentStore method
    2014-02-28 00:47:25, Info                  [0x0801dc] Closing catalog file
    2014-02-28 00:47:25, Info                  [0x0801dd] Deleting catalog file at C:\Windows\Temp\tmpD142.tmp\Temp\tmpD79A.tmp
    2014-02-28 00:47:25, Error  [0x0802f5] CMediaManager::Close: m_pSelectedTransport->Close(1) failed with Exception Win32Exception: Device was open with readonly access.: Access is denied. [0x00000005] void __thiscall Mig::CMediaManager::CloseTransport(int)
    void __thiscall Mig::CUNCTransport::Close(int).[gle=0x00000006]
    2014-02-28 00:47:25, Error   [0x000000] MigCloseCurrentStore caught exception: Win32Exception: Device was open with readonly access.: Access is denied. [0x00000005] void __thiscall Mig::CMediaManager::CloseTransport(int)

    I wish I could say the problem was fixed but I'm still having an issue on a very small percentage of machines with last nights deployment of 82 only one had the problem. It's still a very good success rate and the machine did convert to windows 7 just the
    loadstate didn't complete. Data again is intact in C:\UserState until it is restored which requires manual follow up by a tech.
    From the logs it fails with a domain profile not a local user account as below:
    22:58:24, Info   [0x080000] Creating profile for user S-1-5-21-1846115490-1004743732-623648099-18044, MYDOMAIN\jkirk. Using existent SID
    22:58:24, Error                 [0x080000]
    There was an error while calling CreateProfile. Error: 0x800700B7
    22:58:24, Info                  [0x0803e5] Not unmapping HKCU; it is not mapped
    22:58:24, Error                 [0x000000]
    Error 0 creating profile for user MYDOMAIN\jkirk (source user MYDOMAIN\jkirk)
    22:58:24, Info                  [0x000000] Failed.[gle=0x00000006]
    22:58:24, Info                  [0x000000]   A Windows Win32 API error occurred
       Windows error 0 description: The operation completed successfully.[gle=0x00000006]
    22:58:24, Info                  [0x000000] Entering MigCloseCurrentStore method
    22:58:24, Info                  [0x0801dc] Closing catalog file
    22:58:24, Info                  [0x0801dd] Deleting catalog file at C:\Windows\Temp\tmp34E5.tmp\Temp\tmp3B2C.tmp
    22:58:24, Error                 [0x0802f5]
    CMediaManager::Close: m_pSelectedTransport->Close(1) failed with Exception Win32Exception: Device was open with readonly access.: Access is denied. [0x00000005] void __thiscall Mig::CMediaManager::CloseTransport(int)
    void __thiscall Mig::CUNCTransport::Close(int).[gle=0x00000006]
    2014-03-03 22:58:24, Error                 [0x000000] MigCloseCurrentStore caught exception: Win32Exception: Device was open with readonly access.: Access
    is denied. [0x00000005] void __thiscall Mig::CMediaManager::CloseTransport(int)
    void __thiscall Mig::CUNCTransport::Close(int)[gle=0x00000006]
    2014-03-03 22:58:24, Info                  [0x000000] Leaving MigCloseCurrentStore method
    If anyone has suggestions on this it would be appreciated. Thanks

  • HT201699 I'm using an iPhone 4 which i purchased last month, there seems to be some kind of problem with the mobile data network

    Hi,
    I bought a new iPhone 4 last month, totally fell in love with it untill there was this problem regarding the apn disappearing. I manually added the apn info and it worked fine for some time but soon after I disabled the mobile data/3g connection and enabled it later I always use to get a msg saying "Could not activate mobile data network" even after it being active( 3g symbol always used to be poped up at the top). Though the apn is filled with a valid data it shows me the same msg over and over again. It some times works on rebooting but the rebooting the handset everytime i want to use the connection sounds very pestering. Please suggest me with somehting to get rid of this problem...

    https://discussions.apple.com/message/21946322#21946322

  • Hi every time I go to write a tx on my iPhone it asks for my apple I'd sign in like when I buy an app or something and you have to enter your password is there a way to stop it doing this or is there some kind of problem with the phone

    Hi every time I go to write a tx my phone asked for my sign in details like I have just bought something like an app of song ect I just press cancel and it goes away but still pretty annoying is there a way to stop this or is there a problem with the phone  ? Thanks

    If the login box keeps popping up either your acct is disabled or you are mistyping your pw.  
    Go here and try out your pw and reset if necessary:
    http://appleid.apple.com/
    Click on Manage ID and go from there.

  • Ok got some kind of horrible *** problem (charging)

    rite heres the thing, may have left my ipod on all nite and drained the battery.
    i've reset the ipod keeps turning back on. i've connected it to the computer to charge, the comp doesnt recognise it, and doesnt charge. wont turn off. and the screen seems 2 always have the apple logo on it. (silver + Black)
    its a video ipod. and just keeps coming up with colourless battery signs. i have no idea wat to do. can some1 pls help me. i've only had it since march and dont rele want 2 replace it
    PC   Windows XP  

    See these.
    The Five Rs.
    iPod shows only an Apple logo and doesn't start up.
    Only the Apple logo appears when turned on.
    My iPod won't wake up.
    iPod battery doesn't charge.
    Your Windows PC doesn't recognize iPod.
    When restoring the iPod, put it into disk mode first.
    Putting iPod into disk mode.
    "its a video ipod."
    And you're posting in the iPod nano forum?? : )

  • TS1424 My grandson was playing temple run and tried to down load coins. The IPAD frozen so he kept pushing the button and I now have a forty dollar bill for coins. Can I get some kind of help with this?

    My five year old grandson was laying Temple Run and tried to down load extra Coins.  The IPAD froze up so he kept hitting the button to get his coins. I ended up with a forty dollar bill for coins. Is there any way of geting this corrected? 

    In app purchases can be restricted in Settings/General/Restrictions.
    For all other things, try to contact iTunes support, maybe they can help.
    Apple - Support - Express Lane - Product Selection

  • Is there some kind of problem with Apples servers?

    My Apple TV suddenly said theres an update available so i went ahead and it gave me this-
    Although it went quick but when it applied the update it failed and now im stuck on the Apple logo

    I had no problem on my system. Are you on wifi? Maybe there was some interference at play. In any case, since it failed you will have to grab a micro usb cable and restore through iTunes
    http://support.apple.com/kb/HT4367

Maybe you are looking for

  • Regarding Workflow Notification

    Hello everyone, Suppose if a Workflow Mailer sent an email but the email was bounced because the recipient mail box is full / recipient address is wrong or domain is wrong in such cases is there any table or any place where I can see the reason for f

  • Can't Update Pages to my iMac. it says "already installed" but! Pages says 4.3.

    Can't Update Pages to my iMac. it says "already installed" but! Pages says 4.3.

  • "Could not find the main class" when running a jar

    Hi, I'm trying to create and run a jar from my application, but I can't figure out how to properly set an entry-point. Looking at the Java Tutorials http://java.sun.com/docs/books/tutorial/deployment/jar/index.html I still can't get it to work. I hav

  • Need remote lock and password reset

    This question is in regards to this thread: https://social.technet.microsoft.com/Forums/windows/en-US/499f83d0-36f8-4f29-a4ce-e32f76632c90/intunesccm-mobile-application-management?forum=microsoftintuneprod -We currently have ConfigMgr 2012 R2 and wan

  • Fonts appear in color when emailing to a commercial printer

    I prepared a newsletter in Pages'09 with color photographs. I sent it as a PDF file to a commercial printer for printing hardcopy. I never changed the default on the text. Below is the response I received from the commercial printer. When I open the