How to stop JList selection?

Hi,
Is it possible to stop the JList box selection? i.e. keep the selection at the old selection. I tried the following in the ListSelectionListener valueChanged() method:
if (e.getValueIsAdjusting()){
// Do something to the old selection
// if something is wrong,
list.setSelectionInterval(old_index, old_index);
else {
// do something to the new selection.
But this is actually REVERTing the selection, but not STOPPing the new selection. Since it is in the valueChanged() method, I guess there is no way I could STOP the selection here.
Does anybody know where and how to "veto" a list selection event? Note that this will be triggered by user's mouse click on the list box.
Thanks!

You'll have to do it in a new thread, try the SwingUtilities.InvokeLater method like this:
   if (e.getValueIsAdjusting()){
// Do something to the old selection
// if something is wrong,
       list.setSelectionInterval(old_index, old_index);
   } else {
       SwingUtilities.invokeLater(new Runnable() {
          public void run() {   
// do something here
   };o)
V.V.

Similar Messages

  • How to stop the Selection Tool from selecting effects around objects?

    This question is for Illustrator CS5.
    I can't seem to figure out how to fix this problem. I vaguely recall finding a solution in CS4, but cannot recall how it was achieved:
    Scenario: If I have a number of shapes on top of each other, with, for example, a drop shadow on the top shape, whenever I try and select the shape below it (it is peeking out from beneath the top shape, so I click on this 'peeking' section of the shape to try and select it) I cannot - it just selects the top shape as the top shape's drop shadow is 'blocking' the shape below it. Make sense?
    How do I go about about remedying this? I seem to recall being able to tell Illustrator to ignore 'effects' when making selections in CS4, but cannot work out how to do this in CS5. And is there a way to refine the 'sensitivity' or selection radius when clicking to make selections?
    Hopefully someone with the knowledge can please advise?
    Many thanks.

    Never heard of ignore effscts for this.
    Couple way to solve this
    CMD Click on the already selected top element, to select the element underneath.
    You may have used the visiblilty eyeball in the appearance pallette to temporarily hide the drop shadow
    You can use CMD 3 to hide selected top elements, make the change you need, then Opt CMD 3 to unhide
    For #1 to work, don't click too fast, or else your clicks will register as a double click rather than a 2nd clikc (depending on what you have set in you Keyboard preferences).
    I mention #3 cause this is a very useful tool for cleaning up and grouping complex documents, when you want to select multiple elements.

  • How to stop the selection of an empty table?

    Hello , everyone.
    I created a JTable : tableView :
    tableView.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    tableView.getSelectionModel().addListSelectionListener(this);
    tableView is a empty table , that is to say , tableView.getRowCount() returns 0 .
    When the table has focus, I press ENTER key , it will invoke the table's ListSelectionEvent event.
    So , in the ListSelectionEvent interface:
    public void valueChanged(ListSelectionEvent _e)
    I call :
    int selectedRow = tableView.getSelectionModel().getMinSelectionIndex();
    selectedRow value will increase with ENTER key pressed each time .
    My question is how to prevent from ENTER key event when a table is empty ?
    Thanks in advance .

    There is no table, unless you have a mapping table or an overflow segment, so the size is the bytes for the index segment. So yes, your query is probably correct. NB you will only have multiple segments with the same name, if you have partitioning, so you might not need the SUM .. GROUP BY

  • JList selection is listened twice

    Hi
    How to make JList selection listener to catch selection events for only one mouse click (mouse pressed or mouse released)

    Hi,
    you are right!
    first time e.getValueIsAdjusting() is true second time
    it is false. It does not corrspond to mousePressed or mouseReleased. I think the first is an item loosing selection and the second is another item getting selection (just a guess).
    Phil

  • How do i pass selected value of JList in one frame to other frame?

    hai everybody,
    In my application where i m using swing as GUI in that i require selected value of Jlist in one frame to other frame ..
    Since i need the previous frame jlist selected value for my application.
    How this can be done
    Help me pa
    Thanx in advance

    You need to post your Short, Self-Contained, Compilable Example or SSCCE if you need further help.

  • How to stop the option key from changing tools when trying to subtract from a selection?

    How to stop the option key from changing my tools when I am trying to subtract from a selection?
    I'm running CS3 on Mac OS Leopard, and the automatic tool switching slows me down, but even preferences doesn't show a way to turn this off.
    Thanks for your help.

    With any marquee tool, JUST holding down the option key should not switch tools. You need to explain the problem much more carefully, It's completely impossible to tell from your description whats going wrong.
    automatic tool switching
    The only preference related to this, is to do with the SHIFT KEY - "use Shift key for tool switch".

  • How to stop Mail from selecting addresses from the list of Previous Recipients?

    How to stop Mail from selecting addresses from the list of Previous Recipients?

    This is a related question.
    I deleted ALL my previous recipients and when I create a new e-mail it STILL is getting addresses that I don't want - they pop up and I don't know how to stop this!
    I switched from one ISP to another - I deleted the old e-mail account in MAIL - I DID use the same name on the account - is that why it keeps bringing up the old address? 
    ARGH!

  • HT1386 My iphone5 itunes playlist seems to have a mind of it's own, after selecting a song to play it will randomly flash through songs on my playlist without stopping. I've rebooting, and restored my iphone with no results. does anyone know how to stop t

    My iphone5 itunes playlist seems to have a mind of it's own, after selecting a song to play it will randomly flash through songs on my playlist without stopping. I've rebooting, and restored my iphone with no results. does anyone know how to stop this from happening? also I am having trouble syncing songs from my library on my computer to my iphone. the songs so up on my playlist on the computer, but will not synch over to my iphone5. Thank you.

    Hi TakesTwo2Tango,
    Thanks for using Apple Support Communities.  It sounds like you should definitely be seeing a plus sign after tapping Edit, so I would try a couple relatively easy things (closing the Music app, resetting the iPhone):
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430
    Cheers,
    - Ari

  • How to use JList's ensureIndexIsVisible and multiple selection using CTRL

    Hello everyone. I am stuck on how to use JList's ensureIndexIsVisible() method and to also allow multiple rows in the list to be selected. Currently, when I begin typing a number stored in the list (i.e. 10001) the focus will go to that row; however, when I press the CTRL key and begin typing another number (i.e. 30001) the focus never goes to the new row. I have a suspicion that I need to cancel out the CTRL key somehow when typing the numbers but also need to keep the knowledge that the CTRL key is pressed to allow for multiple selection. Thanks in advance for your help!
    Regards,
    Will

    Hello everyone. I am stuck on how to use JList's ensureIndexIsVisible() method and to also allow multiple rows in the list to be selected. Currently, when I begin typing a number stored in the list (i.e. 10001) the focus will go to that row; however, when I press the CTRL key and begin typing another number (i.e. 30001) the focus never goes to the new row. I have a suspicion that I need to cancel out the CTRL key somehow when typing the numbers but also need to keep the knowledge that the CTRL key is pressed to allow for multiple selection. Thanks in advance for your help!
    Regards,
    Will

  • How to 'veto' a jList selection change

    Hi All,
    I have a JList which I'm using as a record selector - so whenever my user selects an item on the list, the associated record is loaded up into the other controls on this form for editing. If the user edits any of the data items, I want to ask whether to save changes or not if another item is selected from the JList. So, I've added code in my 'selection changed' function to check for changes and show a 'yes/no/cancel' JOptionPane. The code for my 'yes' and 'no' respones work fine - either save the changes or not, then show the next record. My problem is handling if a user clicks cancel...
    If the user selects 'Cancel', I dont want any of my "show new record" code to execute (this is easy, I can just 'return' out of the function) but also I don't want the JList selection to change. I've tried calling setSelectedIndex() back to the originally selected item, but this in turn triggers my 'selection changed' function to be called again, which causes the user to be asked twice whether they want to save changes!
    So, what I'm after is a kind of beforeSelectionChanged event, which allows the possibility of denying the selection change - but it doesn't look like this exists! I vaguely remember another language (possibly C++/MFC) having this - the user's action could be ignored depending on the return value of the function. Can anyone offer a way of achieving this in Java?
    (It's been a while since I last touched Java, and I'm a complete n00b with Swing. Using NetBeans as my IDE.)
    Thanks in advance for any suggestions!
    Andy

    The way I do it, is to implement a VetoableSelectionModel similar to a bean with a vetoable property: on selection change it queries registered VetoableChangeListeners if they don't object and backs out if one of them barks.
    HTH
    Jeanette

  • Can't figure out how to stop my MBP from opening programs at startup, namely word and messages

    Recenty my MBPro has started opening MS Word and Messages at startup and I can't figure out how to stop it?  I've tried selecting and de-selcting the startup option from the dock but this doesn't help.  Does anyone have any suggestions?

    System Preferences has a setting for this.
    In the Users & Groups section you will fine a "Login Items" header.  This is a list of all the programs that will open automatically when you log in.  You can select any program and click the [--] button below that window to stop the program from opening automatically.

  • Difference between billing and invoice?  How to stop PGI?

    can u please help me in these questions.
    Difference between billing and invoice?  How to stop PGI?

    Invoice is document indicating to delivery goods and Billing is a receipt of payment
    Tables are VBRK & VBRP. For flow, go to transaction VF03, enter document number and hit 'Display Document Flow' button on toolbar
    vbrk and vbrp holds billing/invoice details..
    Billing Document:
    Generic term for invoices, credit memos, debit memos, pro forma invoices and cancellation documents.
    The tables are VBRK and VBRP.
    2)-- once u do PGI the delivery document will be created . there is no way to stop it  .. the thing u can to do go to the list of created deliveries in VL09.. select the delivery doc which u created.there  u have the option of reversing the goods or canceling it.
    let me know if i am wrong...
    thanks,
    madhan
    Message was edited by:
            madhan n

  • External Hard Drives - how to stop LR3.3 wanting to import.

    I have 3 external hard drives which I use for backing up pictures and other folders. Whenever I plug one of them in, LR opens the Import dialog, even though I have auto import switched off. It's not serious, but it is annoying! Can anyone tell me how to stop it doing this?

    Try the following:
    In <My Computer> right-click the external drive, in the dialog box click on <Properties>, and on the <Autoplay> tab. Select <Pictures> and Make <Select an Action to perform> active by clicking on the radio button. Scroll down the list and make sure that <LR import photos> is NOT selected. Or select <Take no action>.
    WW

  • How to stop HP Annoying Status Message Windows?

    Before posting this message now (July/2014) I've searched for related posts here. I found one from 2009, whose author got a solution through an answer only in 2012 (pasted bellow).  I have the same problem: I'd like to stop the invasive alert messages from HP Solution Center without uninstalling the software, which is very good, but for these annoying stupid messages.  I say stupid messages, because everytime I seat in front of my desktop it insists telling me, for example, that I have a problem: the language in my HP printer doesn't match the language in my computer.  But this is not a problem, it is my personal option! Anyway, HP Solution Center keeps poping up everytime I awake my screen and this is really annoying, even it its messages were accurate.  HOW TO STOP THEM? As I said, the solution found here in the forum after 3 years (2009-2012) doesn't work for me, because there is no "status messages" in my "device settings" (Windows 7), so I could turn them off.  I'd appreciate any help!
    SOLUTION: To stop HP Annoying Status Message Windows.[ Edited ]
    ‎05-26-2012 01:05 AM - last edited on ‎05-26-2012 10:13 AM
    Hi, Friend I have solution how to stop HP Annoying Status Alert .
    WIndows 7
    First Click START>CONTROL PANEL>PRINTERFAX>
    Select Your Printer And Go to Properties
    Click Device Setting > Select Status Message OFF Option
    Press APPLY And Ok
    Reset Your Computer

    Hello Fernando_int, and welcome to the HP Forums.
    I see you are recieving false errors.  I would like to assist.
    I would suggest Uninstalling the Printer Software.
    Once it is uninstalled, I would suggest putting your system into clean boot mode within the Microsoft configuration.  You can do so by following this document: How to perform a clean boot in Windows.
    Once the computer is in clean boot mode, I would suggest reinstalling the HP Printer Install Wizard for Windows.
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • How to stop WF-BATCH Technical Alert

    Hi everybody,
    I going to explain my case.
    - Everyday I receive a lot of email about WF-BATCH Tecnical Alert into my Inbox. The problem is that the message doesn't have any information, therefore I can't identify what interface throws these alerts. The content of message is like:
    Alert ID: ##43571##
    +----
    +
    Información Técnica
    Código Error:
    Categoría:
    Message ID:
    System ID: PX0
    Mandante: 001
    Sender Interface:
    Sender Namespace:
    Sender Component:
    Receiver Interface:
    Receiver Namespace:
    Receiver Component:
    Adapter Engine Errors
    Adapter Type:
    Error text from the Adapter Engine:
    - Analyzing the case, I detected that we have one interface related to FSCM (CreditCommitmentNotification). When an error ocurrs, the alert is throwing, but this happens on ECC and not in PI.
    Someone knows how to stop those alerts? or What configuration of FSCM is made?
    Thanks
    Vicman

    If u schedule this job from SM36 then u can make it active or inactive from there only. From SM36 ..give the name of ur job then press Extended job selection button..then in next screen choose Active tab and there u can check the checkbox "Job on longer active in time interval" and then give ur time.
    Hope this info will help u.
    Regards,
    Joy.

Maybe you are looking for

  • Can not change country to deliver book to.

    Hello, How do i change the shipping address from Canada to France for a book in Iphoto 11. T

  • Work Flow integration with Abap Web Dynpro's

    Hi, We are currently working on Custom ABAP WD Applications which gets called from Workflow. For eg., we are trying to simulate the ESS Leave Process, like Java WD Leave application gets called on execution of Leave Approval Workitem. We developed ou

  • Problem in posting GR due to  FY closeing error in new instalation of BPP

    Hi Friends , I am geting following error when posting GR in new system of development , Please suggest , it was not possible to sort through MMPV . "Posting only possible in periods 2008/01 and 2007/12 in company code 1000 Message no. M7053 Diagnosis

  • Dreamweaver synch has exploitable insecure holes?

    The company who hosts the server for one of my (Dreamweaver) websites sent me this note advising me to use WinSCP to upload files to the server, specifically requesting I not use Dreamweaver: "Many propriety software packages like Dreamweaver contain

  • Nvidia performance is starting to annoy me...

    Ok, maybe this post is a troll but the performance I get with my nvidia (FX5600) really annoys me. Seriously, I use linux since 5 years and I always recommand nvidia card to new users. But, the last 2 or 3 release of their drivers are so wrong. 1- I