Why I press button only once, but it executes 2-4 times??

Dear Sir:
I used following code in a project, when I press buttonTest only once, looks like it execues 2 or three times.
and it outputs:
I am testing
I am Calling a new testing
I am testing
I am Calling a new testing
Class myButtonTest(){
      public void actionPerformed(ActionEvent e) {
          if ("Test".equals(e.getActionCommand())){
                   System.out.println("I am testing");
                   buttonTest.setBorder(red);
                          CallAnotherTest();
public void CallAnotherTest(){
                        System.out.println("I am Calling a new testing");
public void myButtonTest(){
                    MotherCall motherCall= new MotherCall();
                    motherCall.buttonTest.setActionCommand("Test");
                    motherCall.buttonTest.addActionListener(this);
public Class MotherCall(){
          JButton buttonTest= new JButton();
}I only need it executes ONCE, no more no less,
Can Guru help??
Thanks

You can't be using the code you posted as it is far from being able to compile:
* a class declaration with parameters
* a class that is supposed to implement the ActionListener interface but doesn't declare this.
etc..
Please post the real code used.

Similar Messages

  • Why does a new run once start up program run every time I start my computer? The start up program is coming from Reader XI. The only name on it is a number starting with 141_______.

    Why does a new run once start up program run every time I start my computer? The start up program is coming from Reader XI. The only name on it is a number starting with 141_______.

    See also https://forums.adobe.com/thread/1654402

  • Hi, how are you? I have a question. I bought the ringtone "Dancing Queen" once but it charged me 7 times. How can I remove the 6 other purchases?

    Hi, how are you? I have a question. I bought the ringtone "Dancing Queen" once but it charged me 7 times. How can I remove the 6 other purchases?

    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • LV 8.6: programatically pressing button only works in some VIs, not all?

    Setup is an old labview 8.6
    I'm tasked with fixing some strange old engine test bench which has a ~1E-6 measurement drift.
    The "easiest" work around fix would be to run the mechanics to a bottom end point then press the "reset" measurement button automatically.
    !!:  A "drive" vi and a "measurement" vi has to be running at the same time. The drive vi will then periodically drive the test bench to a mechanical end point and reset the measurement vi. This would get rid of the drift.
    !!:  Both vi's must be started manually and running. I cannot start one vi from the other. It messes things up. I know not why. There seems to be some strange dependency over compiled FPGA code somewhere.
    I'm no lab view wizard. It was 20 years since I touched it last.
    So digging through examples on how to press a button in one VI from another VI I found this:
    https://decibel.ni.com/content/docs/DOC-15962
    Which I built into a sub-vi and a test setup to see if I could make it work on the test bench. With some tweaking it works.
    A test "master" vi can press any button in a test "slave" vi.
    However. It is impossible to press the "reset" button in the "measurement" vi.
    Labview reports no errors, it just doesn't execute the value change event as far as I can understand.
    In fact, I can copy exactly the same code from the working "slave" vi into the "measurement" vi and it stops working. !!??
    How can code work perfectly well in one vi but not in another ?
    The "measurement" vi has some sort of compilation requirements, meaning any change to the vi takes >30min to "compile" before it can be run. Can this have something to do with why remote button pressing doesn't work?
    It also interfaces with some FPGA somewhere, can that have something to do with it ?
    I have no clue. Happy for any help here.

    Here it comes -- WARNING -- ugly code, this is my first labview in 20 years and I'm very short on time.
    press-button.vi
      the sub vi I mangle up from the example (https://decibel.ni.com/content/docs/DOC-15962)
    master.vi
      the test event sender
    slave.vi
      the test event receiver
    measurement.vi
      the real vi, where no buttons can be pressed
    In master.vi you can reconfigure the input to press-button to which vi and button to target. Right now it is set for the test slave vi (I think) to verify that it actually works as intended in the test environment.
    Hmm, seems there is a limit to 3 attachments, will post the measurement.vi in next post
    Attachments:
    press-button.vi ‏15 KB
    master.vi ‏19 KB
    slave.vi ‏29 KB

  • In Firefox 4, back button only goes back 1 page at a time. how can i go back further with one click?

    in Firefox 3.6.10, i could click an arrow next to the back button for a drop down menu of previously visited pages. in Firefox 4, i can only go back one page at a time. has it been removed in the new version or am i just overlooking it?
    in case you've taken it out, would you consider replacing it? sometime a page won't let you go back no matter how many times you hit the back arrow.
    thank you!

    You can get the drop down list by either right-clicking on the back/forward buttons, or holding down the left button until the list appears.
    If you want the drop-down arrow you can add it with the Back/forward dropmarker add-on - https://addons.mozilla.org/firefox/addon/backforward-dropmarker

  • Why does the button only work in test scene, not test movie?

    Hi everyone, I have a very frustrating problem with my flash project.
    I have two scenes in my flash movie, each of them has lots of links and navigation within itself. And there is one button that takes you from one scene to another.
    When I test Scene 2, everything works fine. However, when I test the whole movie, the navigation within Scene 2 won't work and there is no error!
    Does anyone has any thought about what is going wrong?
    I'm using Flash CS6.
    Thank you!

    Thank you for replying me!
    My Scene 1 has some key frames and some gotoAndStop functions navigate between the frames. My Scene 2 has basically the same set up, but different content.
    Then I use a button to jump from Scene 1 to Scene 2.
    Here is the code:
    var StoreHomepressing:Boolean = false;
    function StoreHomeonPressing(evt:Event){
              if (StoreHomepressing==true){
                        gotoAndStop(1,"Scene 2");
    function StoreHomehandlePress(evt:MouseEvent){
              StoreHomepressing = true;
    function StoreHomehandleRelease(evt:MouseEvent){
              StoreHomepressing = false;
    StoreHomeBtn.addEventListener(MouseEvent.MOUSE_DOWN, StoreHomehandlePress);
    StoreHomeBtn.addEventListener(MouseEvent.MOUSE_UP, StoreHomehandleRelease);
    addEventListener(Event.ENTER_FRAME, StoreHomeonPressing);
    "StoreHomeBtn" is the instant name of a the button. Through this code, I want it to go to and stop at frame 1 of Scene 2 on pressing this button. It does jump to frame 1 of Scene 2, but once it goes to Scene 2, all the gotoAndStop functions in Scene 2 don't work and no errors show up.

  • Mail 5.3 is deleting multiple messages when I click the trash button only once!  Is there a fix for this bug?

    Hi,
      Any help appreciated!  I recently ungraded to OSX 10.7.5 (Lion) and ever since, I am having trouble with my mail that I did not have before.  When I am going through messages and I use the trash button, it sometimes deletes multiple messages that I have not even opened or read yet.  I only click the button once.  Any ideas how to correct this?
    Thank you!

    Thank you. I figured it out right before I heard from you.  Running the OCR before the redaction made it work correctly.
    Thank you so much for taking the time to answer my question.
    Make it a great day.
    BG10

  • HT204088 My purchase history shows that I am charged only once but my bank statement shows tha I am charghed thrice

    I purchased Whatsapp and I was charged once.After that I only downloaded Free Apps but I am charged twice in my bank statement but purchase history shows only 1 purchase in AppStore

    To Contact iTunes Customer Service and to request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Why the home button sometimes work but?

    My friend's iPhone 4 dropped and cracked a little bit on the front but now the home button is not responsible but sometimes it works. What is damaged?

    Probably the spring on the home button. It is all one unit to replace it.

  • Why batteries 75% power only once fully charged on MagicMouse?

    I am using Apple Battery Charger (including the batteries)..

    There are a combination of factors.   The batteries reach a state of charge, then relax, so to speak, and can then accept more charge.   The first figure recorded on your machine may be 100% but within minutes can drop to 80% in this 'relaxed' state.  If you take the batteries from the charger immediately the green light shows, they are rarely fully charged.   You can test this by unplugging and plugging the charger back in a few minutes later  and the light will turn to amber .. and stay that way for some time.   This second charge when the light turns green is more likely to register as 100 %.   
    Additionally, after several recharges, the batteries do not charge up quite so efficiently and last for a shorter time.   Then, if batteries are stored fully charged for a few days, they tend to run down.    And to finally confuse things, some machines do not show the correct amount of charge.
    Best to accept this relatively minor inconvenience in exchange for having charged batterioes in reserve.
    Ususally, I find the batteries are good for between14 to 17 days on an iMac.

  • Only movie but no sound in Quick time

    I have encountered a problem when playback some of my movies on the Quick Time Version 7.1.5.
    The file details are as follows:
    Format: DivX 6.0, 640 x 480, Millions
    MPEG, Mono, 22.050 kHz
    Many Thanks for your kind help...
    John

    Divx with MPEG audio is a potentially troubling combination. Try installing the Perian components, that is likely to solve a lot of issues:
    http://perian.org/

  • Read config file only once for beans

    I want to read onfiguration file Myconfig.cfg with many global values (server IP, port, database URL, pages, etc) I'm using a bean but every time a JSP or servlet create an instance of that bean all the data has to be read form disk...
    I know that if I put the code for reading the file in the init() method in a servlet it is called only once, but how do I read those values from another servlet or JSP, ???
    What is the best solution...

    You can put initiation parameters in your web.xml file and write a servlet that is called on startup. Once the values are read you can put them into the application scope. (i.e. application.setAttribute("jdbcUrl", jdbcUr); )
    Then in your JSP pages you can take them out by using the application.getAttribute("jdbcUrl"); method.

  • Itunes 10.5: It starts once, but not twice....

    Hi there everybody,
    I have a question, I have myself a new gaming pc, everything works, software, hardware, no problem at all.Itunes also worked perfectly, I use itunes, because I have an i Phone and, well, I just need Itunes to sync everything.
         Now a few days back, my Itunes started acting up, all of a sudden it kept asking me for my password because it needed authorization for automatic downloads. Also, Itunes would boot only 1 time, not more, whenever I closed it up and needed it to boot up again, it wouldn't. After a reinstallation, I kept having these problems, so I deleted Itunes again, and deleted every Apple related directory from my pc, even within the hidden directories. I knew that this would maybe help, cause alot of programs these days don't delete everything, even if you tell them to;) It sort off helped, I don't have the problem with the password asking anymore, but still Itunes only boots once a  "pc startup".
    The Symptoms:
    Itunes boots once, but not for a second time.
    Itunes.exe and ItunesHelper.exe do show in the processes tab of the task manager.
    Whenever I close these processes and I try to start Itunes, Itunes freezes on my screen as a square gray space.
    Can someone please help me, cause, as sad as it sounds, I am really annoyed by having a brandnew pc, having everything work perfectlly, better than ever, and still have 1 program that doesn't work properly...Itunes.
    If you need any more detail, just ask me:)
    Thanks everyone!

    Seems like I found myself a solution with the help of some random thread I found (thank god), seems that APSdeamon, also known as ApplePush, seems to cause the prblem here. Terminate the process in the process tab, and everything works out fine again. Maybe a bit drastic, but you could also delete the .exe file and never have the problem again.

  • The Back button only allows me to go back one page at a time instead of selecting a previous page from a drop-down list. This is a real problem: anyone have any ideas?

    In the previous version of Firefox, I could go back to a previous webpage by clicking on a part of the Back button which brought up a list of recently visited sites, and by clicking one of these, could jump straight back to that page. This facility does not seem to be available in the latest Firefox, and the Back button only goes back one page at a time. This is really inconvenient, as,
    it now takes longer to get to an earlier page
    there is no visibility of previous pages visited
    any actions carried out on webpages are undone when going back through them - this does not happen when jumping back several pages in one go.
    This is a real problem as I used to the old system constantly, and cannot continue to use Firefox 4.0 unless there is a way around it.

    For me, I have the same question, this is a poorly done upgrade and I want to go back to 3.6

  • I have reached out  to this community as my Iphone display gone black and got the solution to keep home and power button pressed. It worked but I would like to know why it went black

    I have reached out  to this community as my Iphone display gone black and got the solution to keep home and power button pressed. It worked but I would like to know
    1. Why it went black and is there a permanent fix for this
    2.Will the IOS gets automatically updated as I feel the IOS was 5 when I got the phone in 2012 december
    3.Do you suggest 7.1 for Iphone 4

    1. There is no way of knowing. These things happen.
    2. The iOS only gets updated when you want it to be.
    3. You should always update to the latest iOS your phone will support. Apple do not write the updates to make your experience worse.

Maybe you are looking for

  • How to schedule Adapter to Pickup File on external FTP Server

    Any solution is very much appreciated for the following Problem. My Scenarios are  File to XI to FIle My problem is XI is picking up file on FTP Server while file is being written by Webservice ( This Webservice can not write .tmp file or movie file

  • Internet blocking access to certain websites and M...

    I had BT Infinity installed about 3 weeks ago and since then iMessage on my iPod has worked at random times, getting a 'Message Could Not Be Delivered' which was annoying, but as of today I can't use Windows Live Messenger on either my iPod or Laptop

  • Address book does not sort correctly

    I have not been able to get the address book to sort correctly. If I go Preferences/General/Sort by Last Name, it only sorts about half. I discovered that the ones that don't get sorted are ones that have had the "Swap first/last name" function appli

  • Backing up your backups: the right way.

    Hello everyone. I've been searching a lot online but haven't found anything that could help me doing what I need to. Have anyone ever tried to make a Backup of only one particular time machine backup ? Let me explain: I have a hard drive full of time

  • Creating a view using With causes ORA-00600 Error

    Hello Ladies and Gents, I've been trying to deploy a recursive query as a view in Oracle XE and Standard Edition, neither to much success. The query is located in this question here: http://stackoverflow.com/questions/17358109/how-to-retrieve-all-rec