JList ListSelectionListener executes twice! I only need it to run one time.

Hi everyone!
I am having trouble with my list selection listener. Every time I select an item in the JList the code for my listener runs twice.
For example, the code snipet like this:
ListSelectionListener listSelectionListener1 = new ListSelectionListener(){
          public void valueChanged(ListSelectionEvent listSelectionEvent){
               System.out.println("Hello");
     };This will print "Hello" twice and I can't figure out why. It is murdering my program. I have another way of getting around it but it is not very efficient and it makes the program much slower due to a special engine I have initiated during runtime. If there is a way to only get the code to execute once I would appreciate any help.
Thanks!
~Chris

See ListSelectionEvent#getValueIsAdjusting
One event is fired every time the list selection changes, for instance, if the user is selecting 5 files by dragging, 5 events will be fired with getValueIsAdjusting == true. Finally, another ListSelectionEvent is fired with getValueIsAdjusting == false, indicating that the selection process is finished. Seems you only want this last event, so just check the event object so see whether or not to react to it.

Similar Messages

  • My downloaded appl run one time only, my downloaded appl run one time only

    i download many application from apple store they run some time only then they currupt (not open)

    Do a reset (Hold Sleep/Wake and Home buttons about 10 secs or more till Apple logo appears)

  • Why Update query is executing twice in this case even if called one time?

    Example 1=>
    I have unix ksh file and I am calling sql file from it.
    (table 1 contains 2 rows -
    ID      Name
    1 test't
    2 Pet's
    below sql statement is part of sql file:
    update table1 set name = replace(name,'''','''''') where instr(name,'''') > 0 ;
    2 rows updated.
    2 rows updated.
    --after this update I see name is updated to test''''t and pet''''s
    (Problem here is I see 2 rows updated two times.even if there is one row its getting updated two times)
    Example 2)
    SO I have created other ksh and sql and in that sql I have written same update and its working fine.
    update table1 set name = replace(name,'''','''''') where instr(name,'''') > 0 ;
    2 rows updated.
    --after this update I see name is updated to test''t and pet''s
    Why there are 2 updates in first example?

    Please always provide the required information (as said in the forum's stickies): at least sqldev, OS, JDK and DB versions.
    Regards,
    K.

  • I created a form with Single Choice fields, 4 days with times listed. But, I want the user to only be able to choose one time, and the time chosen to be unavailable for other users. How do I do this?

    I created a form with Single Choice fields, 4 days with times listed. But, I want the user to only be able to choose one time, and the time chosen to be unavailable for other users. How do I do this? I have 4 blocks of Single Choice fields in order for the summary page to give me each day in the final report. But, I need the user to be able to make a selection of any day and time and that apointment to no longer be available to future users when they log in. Plus, when the user clicks on the time, they are unable to change their mind and choose another time. Here's the link if you want to see what I'm talking about: 2015-2016 Workload Apportionment Review

    I'm afraid not.    It's not rocket science but you need to do some coding. 
    You'll need to find a script (php) and save it to your local site folder.  Then reference the script in your form's action attribute like so.
         <form action="path/form-to-email-script.php" >
    The input fields in your HTML form need to exactly match the script variables. 
    I'm  assuming you're hosted on a Linux server which uses PHP code.  Linux servers are also case sensitive, so upper case names are not the same as lower case names.  It's usually best to use all lower case names in your form and script to avoid confusion.
    Related Links:
    Formm@ailer PHP from DB Masters
    http://dbmasters.net/index.php?id=4
    Tectite
    http://www.tectite.com/formmailpage.php
    If this is all a bit beyond your skill set, look at:
    Wufoo.com (on-line form service)
    http://wufoo.com/
    Nancy O.

  • Do you really need lion to run face time?

    Do you really need loin OS to run face time?  We just got a ipad2 and I'd like to talk to it but my macbook has leopard.  Any work arounds?

    Facetime on a Mac requires OSX 10.6.6 (Snow Leopard) or Lion.

  • I need to create a one-time database for our Christmas list and print labels.  Is there a free Mavericks-compatible download that will do this?

    Since I will only use it once a year, I am looking for a free download that will allow me to create a small (80-100 names and addresses) database AND print out mailing labels from that list.  I used to have FileMaker Pro 6 and it worked beautifully.  However, it is not compatible with my new operating system - Mavericks - and I am not willing to spend $180 for the necessary upgrade to FileMaker Pro 12, especially since I will only be using it once a year.  I have Numbers, which works for my other databases, but it is not designed to print labels.  Help!

    You could create a Christmas list group in Contacts, and use the File > Print facility in Contacts that supports Avery Mail Labels in the layout tab. Simpler and cheaper than learning a database.

  • Why I can only transfer 1 playlist at one time to iPhone 4?

    Never had this issue before with previous iPhones.
    Now using iPhone 4, latest iTunes and Windows 7 64bit. iPhone is running the latest iOS 5.1.1.
    Let's say I have 10 playlists which I've created in iTunes. And I want to copy them to my iPhone. So what I'd usually do is drag the playlist to the iPhone 4 icon. And the songs will start copying to the iPhone.I would then drag the other 9 playlists and ALL the songs would copy over.
    BUT now... when I start to drag the second playlist over, the songs from the first.... STOP transferring and the songs from the second playlist then starts transferring. So out of 15 songs from playlist 1, maybe I now get only 5....
    Any idea what could be wrong???

    Oh... BTW, I tried doing what I usually do to an iPod and it works as expected.
    Just not with this iPhone 4.

  • Upon opening Firefox I get as many as a dozen Firefox pages all at once. I am positive that I have only clicked on the icon one time.

    Restarting my desktop pc doesn't solve the problem. I am using Windows 7 and Version 5.0 of Firefox.

    Thank you for your response; but, I will NOT ever use FF's Safe Mode again until or unless it comes with a WORKING cancel-and-return-to-normal mode switch--a most logical device, that OFF button.
    Anyway, thanks, but several hours of trying to get out of safe mode and finally uninstalling--didn't work--then being unable to reinstall version 9.0.1--didn't work--only to have to perform a system restore, which was unable to install any version of FF without a zillion bugs...I'd rather eat ants than go through all that again--and it's continuing--of the last few hours. Not even years and years of using Explorer has given me the headache that I now have from FF--and if it wasn't for CoolIris, I'd chuck FF in a a second!
    Give me a couple of days to regain my sanity and I might try your--I'm sure--excellent advice. By the way, for me, it isn't McAfee, it is, I do believe, the Memory Test add-on that "magically" came with StretchClock. They're both gone from my system!! Those clever little add-ons are forever off my list of things to try.

  • Orchestrator Console: Only use windows security promt one time for the console and not for the webservice

    Hi there,
    I have read the topics about the 2 windows Security Prompts. When I add the Console Website to my trusted internet sites, and use automatic logon to my intranet. Both prompts are gone. But that is not exactly what I want to achieve.
    Is it possible to retain the first prompt (Authenticate Orchestration Console) but to disable the second prompt (Web service). I have tried to change the IIS Authentication Settings of 'Microsoft System Center Web Service Home' or  'Microsoft System Center
    Web Service Home/Orchestrator2012 Home' from 'Windows Authentication' to 'Anonymous' authentication using the application pool Identity. This gives me the following error:
    Does someone have been able to only preserve the fist prompt? Looking forward to you reply.

    Hi there,
    I have read the topics about the 2 windows Security Prompts. When I add the Console Website to my trusted internet sites, and use automatic logon to my intranet. Both prompts are gone. But that is not exactly what I want to achieve.
    Is it possible to retain the first prompt (Authenticate Orchestration Console) but to disable the second prompt (Web service). I have tried to change the IIS Authentication Settings of 'Microsoft System Center Web Service Home' or  'Microsoft System Center
    Web Service Home/Orchestrator2012 Home' from 'Windows Authentication' to 'Anonymous' authentication using the application pool Identity. This gives me the following error:
    Does someone have been able to only preserve the fist prompt? Looking forward to you reply.

  • Numbers will only let me "save as" one time...

    ... So if I want to save the same document to a different location, that doesn't appear to be an option. How can I, for example, save to my hard drive if I've already saved to the cloud.

    trailking wrote:
    ... So if I want to save the same document to a different location, that doesn't appear to be an option. How can I, for example, save to my hard drive if I've already saved to the cloud.
    TK,
    I also don't remember what happens on 10.7.x, but here is what you could do with Mountain Lion...
    First, your document is stored on your HD already, so that you can work offline. I mention that in case you think you can't work unless you are on-line.
    If you want to save a separate copy for backup reasons, a very good idea, my suggeston would be to simply click on the Filename at the top of the Numbers window and choose Duplicate. You will be presented with a new copy of the document, with the word "copy" appended to the old document name, and it will be selected and waiting for you to customize the name. I suggest that you replace "copy" with "v1" or such to denote a separate version. Next, click on the filename again and choose "Move to...". In "Move to...", choose the alternate storage location of your choice on your HD.
    Jerry

  • Safari 3.2.1 on Leopard single call to cause Oracle report execute twice

    We have a web application that uses javascripts window.open(url) to call an Oracle rdf report and displays report result in pdf format. For unknown reason, the Oracle report got executed twice when only called once from Safari. It only happens in Safari 3.2.1 on Leopard, not in Safari on Tiger. Can you please shed some lights on how Safari works in this matter? Thank you very much, Steve

    Hi Steve,
    It's going to be impossible for anyone to debug with such limited information
    You're more likely to get some JavaScript experts chipping in if you can post some good examples of the code to demonstrate the problematic parts.
    Have you tried running the same code in Firefox with the Firebug extension to confirm the logic is functioning correctly? It's possible that Firebug might indicate where things are going wrong but for whatever reason the bug isn't exposed in Firefox.

  • Web Service ASMX parameter show twice and i only need one

    I'm sorry, i don't found appropiate category for this question.
    I have this code is web service asmx
    Public Structure AA
    Public Num As String
    End Structure
    Public Structure Resp
    Public Ret As String
    Public Men As String
    End Structure
    <WebMethod> _
    Public Function RecTab(ByVal dd As List(Of AA)) As Resp
    Dim strucResp As New Resp
    'Do something
    strucResp.Ret = "0"
    strucResp.Men = "Message"
    Return strucResp
    End Function
    When i publish, SOAP 1.1 show AA twice and just need one
    <soap:Body>
    <RecTab xmlns="http://tempuri.org">
    <dd>
    <AA>
    <Num>string</Num>
    </AA>
    <AA>
    <Num>string</Num>
    </AA>
    </dd>
    </RecTab>
    </soap:Body>
    I try with
    Public Function RecTab(ByVal dd As AA) As Resp
    but on SOAP 1.1 doesn't show AA, i get this
    <soap:Body>
    <RecTab xmlns="http://tempuri.org">
    <dd>
    <Num>string</Num>
    </dd>
    </RecTab>
    </soap:Body>
    I need three levels dd, AA and Num, but just once. How i do to get this?
    <soap:Body>
    <RecTab xmlns="http://tempuri.org">
    <dd>
    <AA>
    <Num>string</Num>
    </AA>
    </dd>
    </RecTab>
    </soap:Body>
    Thanks

    Hi Dave
    I checked your account and saw that the duplicate subscription has been cancelled and a refund processed.
    Kind regards
    Bev

  • Why the code in a user exit is executed twice?

    Hi all,
    I've got a development in a user exit EXIT_SAPMP56T_001.
    This user exit allows us to control the travel expenses.
    When you go to the TX: PR05 you can see a list with travels to add expenses. Here you can select one item on the list and press the edit button to add new expenses.
    We want to control this and we use this user exit for that purpose.
    When the user selects a row and presses the edit button, the user exit is triggered. We can check the values of the table and see which row is selected. But this exit is executed twice. The first time the table doesn't have any changes on it, the second time it has marked the selected row.
    Why is this happening? Why is this exit executed twice? And how can I control that the table is properlly updated?
    Thank you.

    Hi,
    I think this user exist in getting triggered both in the PAI and PBO of that screen.
    For avoiding this use the flag.
    If flag is initial then only your code needs to trigger.
    if flag is initial.
    flag = 'X'.
    then your code.
    endif.
    So when it again comes into the PBO it will check the flag and the same code will not be triggered for the second time.
    With Regards,
    Sumodh.P

  • What if GRANTS statement are executed twice?

    What happens if GRANTS statments are executed twice?
    Will there be any error thrown at the time of second execution?
    And will we need to revert twice in case we need to remove the GRANTS?
    Does it matter which user can give GRANTS if the user has the ccess to pass on the GRANTS for a particular object?
    thanks,
    tik

    To add to what Sybrand said, as long as the username that runs the grant script has the necessary privilege then who issues the grants does not matter. However you cannot directly grant privileges for another users object to yourself even if you can grant them to another user so if the username who ran the script was intended to receive some of the grants then you definitely need to rerun the script.
    Rerunning the script as the intended user would not hurt anything. Only one revoke would be necessary to remove any granted privilege and it can be issued by any user with the privilege necessary to perform the revoke such as the object owner or a DBA.
    HTH -- Mark D Powlel --

  • JSF action executed twice

    Hello all,
    sorry for my bad english.
    I've a simple form with only one <h:commandButton> who execute an action method.
    In this method i need to do a sleep of 60 seconds.
    The strange thing is that while waiting the 60 seconds, the action method is executed twice !
    This is my code:
    SimplePage.jsp
    <h:form id="simple_form">
      <h:commandButton id="ok_button" value="OK" action="#{bBean.doAction}" />
    </h:form>BackingBean.java
      public String doAction()
        try
          Thread.sleep(60000);
        catch (InterruptedException e)
          e.printStackTrace();
        return "ok";
       }Any help is appreciate.
    Carlo

    Hi Raymond,
    thanks for the reply.
    As you suggested , I've created a JSP page with only one form and submit button that fires an action who sleep for 60 seconds.
    In this case action is invoked only once.
    Any suggestion ?
    Thanks in advance
    Carlo

Maybe you are looking for

  • Cannot get progress to show in app store download of Mountain Lion

    Having to re-download Mountain Lion on my mid 2009 MBP from overseas. The ML app shows "downloading" in dock with progress bar under it (and just a hint of blue for hours now), but in the App Store on the Purchases tab it just shows the Mountain Lion

  • Size of string(19) with this data to be inserted

    Format check - fixed length (19) - first 3 digits are INV (wa_BKPF-bktxt(3) = ‘INV’) - digits 4 to 7 is the company code (wa_BKPF-bktxt+3(4) = wa_BKPF-bukrs) - digits 8 to 11 is the fiscal year (wa_BKPF-bktxt+7(4) = wa_BKPF-bukrs) - no special charac

  • Add a Detail Table Row per master row

    Hi, I am currently working on a requirement for a master detail advanced table. I am trying to add one detail row per master row when the page loads based on the link between the two. I have a master table with 20 records and I need to create 1 detai

  • Urgent:Encoding Type

    We have a interface File to file in which we are picking up the file from the ftp server. We have three different files provided. In FCC we are passing the whole data as a single row. We have tried different encoding of the files - UFT-8, UTF-16 and

  • How to create dynamic action

    hi friends, could u plz tell me how to create dynamic action?  with regards, Priya.S