JTree calling setSelectionPath() does not highlight new selection

I have looked throughout many forum entries and this question has been asked a few times but I have not seen a solution that works at least for me.
When I do the following:
          TreePath path = new TreePath(...)
this.tree.setExpandsSelectedPaths(true);          // not sure if I need this
          this.tree.getSelectionModel().setSelectionPath( path ); // this alone should work correct?
          this.tree.scrollPathToVisible(path);
The original selection disappears (no highlighting) but the new one selected does not
I have also tried calling just for fun ...
     this.tree.getSelectionModel().resetRowSelection();
and this.tree.getSelectionModel().reload( path.getLastComponent() );
Does anybody have an idea of what may be going wrong ? The selection path is valid as I have verified it with the debugger.
Any ideas or suggestions are much appreciated
thanks
Doug

          TreePath path = new TreePath(...)
The devil is in the details... Unfortunately your case's details are in the ellipsis! :o)
Try to provide an SSCCE to get informed help, otherwise you can only hope that we guess well. That being said, here is my "guess":
A preliminary: JTree renders selection by comparing nodes pathes with the selection path(es).
As is common in the Java world, these comparisons rely on the equals() methods of the objets that make up the TreePath's components.
If any of the classes involved does not override equals, the corresponding components objects will be considered equals only if they are identical. In other words, a TreePath which contain a "new" instance of whatever class that does not override equals() will never be considered equal to any TreePath created formerly.
Now comes the gory part: DefaultMutableTreeNode (which is the most often common build block of TreeModels and TreePathes) does not override equals().
So if your TreePath are made of DefaultMutableTreeNode components, they will never be considered equal unless they use the same DefaultMutableTreeNode instances, which would somewhat not be a common nor practical way of building TreePathes.
The original selection disappears (no highlighting) but the new one selected does not Under my assumption:
- the original selection disappears (because by construction the original selection's TreePath it is not equals() to the TreePath passed in argument to setSelectionPath(...)).
- no new selection is rendered (because by construction no TreePath in the JTree's model can be equals() to the TreePath argument).
Does anybody have an idea of what may be going wrong ? The selection path is valid as I have verified it with the debugger.Under my assumption:
- you may have verified that the TreePath seemingly contained the expected values (often rendered in a debugger using toString() calls)
- you may have overlooked that the TreePath components were not the same references.
- you may not have executed step-by-step the TreePath.equals() methods nor the equals() method of the path's components.
Keep in mind that this is just an assumption, based on your code fragment (and on prior painful experience with JTree). If i'm off base and you still need help, please post an SSCCE as sugested previously.
Edited by: jduprez on Oct 11, 2009 12:53 PM

Similar Messages

  • When I open iWeb it does not "Highlight" the New site or new page options. It ahs had this issue for over a year! I have tried uninstalling and re-installing it. What do I do? It opens the tutorial video, then when you close it, nothing else is clickable.

    When I open iWeb it does not "Highlight" the New site or new page options. It has had this issue for over a year! I have tried uninstalling and re-installing it. What do I do? It opens the tutorial video, then when you close it, nothing else is clickable.

    Open iPhoto, select a couple of photos and use the Share ➙ iWeb ➙ Photo page menu option.  That has jump started iWeb for others.  I could take a couple of tries.
    If that doesn't work try the following:
    1 - delete the iWeb preference file, com.apple.iiWeb.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iWeb's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iWeb folder. 
    Click to view full size
    3 - launch iWeb and try again.
    OT

  • Mail does not create new emails based on the highlighted mailbox, but rather the receiving mailbox of whatever individual email happens to be highlighted. This was not the case prior to Lion. Is this a bug or an error on my part?

    Mail does not create new emails based on the highlighted mailbox, but rather according the receiving mailbox of whatever individual email happens to be highlighted. This was not the case prior to Lion. Is this a bug or an error on my part? (I do have the setting for creating new emails from the highlighted mailbox checked.)

    The questions about time was not only because of thinking about the Time Machine, but also possible impact on recognizing which messages remaining on a POP server (doesn't apply to IMAP) have been already downloaded. In the Mail folder, at its root level, in Mail 3.x there is a file named MessageUidsAlreadyDownloaded3 that should prevent duplicate downloading -- some servers may not communicate the best with respect to that, and the universal index must certainly be involved in updating that index file. If it corrupts, it can inhibit proper downloading. However, setting the account up in a New User Account and having the same problem does not point that way, unless your POP3 server is very different from most.
    That universal index is also typically involved when messages are meant to be moved from the Inbox to another mailbox -- in Mail 3.x the message does not move, but rather is copied, and then erased from the origin mailbox. That requires updating the Envelope Index to keep track of where the message is, and should keep track of where it is supposed to have been removed after the "Move".
    Ernie

  • My Airplay is delivering Audio but no Video (black screen).  The drop down box has a new selection "use airplay to; it does not let me select 'Mirror my IMac', it is stuck on 'extend desktop'  any suggestions appreciated.

    My Airplay is delivering Audio but no Video (black screen).  The drop down box has a new selection "use airplay to; it does not let me select 'Mirror my IMac', it is stuck on 'extend desktop'  any suggestions appreciated.

    here is fix! i tried only step 1 and then restarted my computer and now it works. Choose remove All Files 
    Hope it helps.
    https://discussions.apple.com/thread/5952624?tstart=0

  • I have a new iPhone 5 version 8.1 - incoming caller ID does not work and I cannot send or receive SMS messages

    I have a new iPhone 5 version 8.1 - incoming caller ID does not work and I cannot send or receive SMS messages. ISP says everything is active on their side. I have just upgraded from Samsung with the same phone number and services. Help?

    Hi cggturner,
    I'm sorry to hear you are having issues with iOS 8.1. If you are still having issues with Caller ID and SMS Messaging, you may find the troubleshooting steps outlined in the following article helpful:
    iOS: Troubleshooting Messages
    Regards,
    - Brendnen

  • Form does not show "new" records from SQL Database

    I have a PDF form that pulls data from a SQL Server.  The fields in
    the PDF are populated from the database after selecting a specific
    record from a drop down and then clicking on a button labeled "Fill".
    The problem is that the dropdown does not display new records that
    have been recently added to the database.  I have to open the form up
    in designer then save it, (*note - I change nothing at this point.)
    Then when the form is opened back up in Adobe the dropdown show all
    the records including the new ones.  I even put a manual refresh on
    form to try and fix this an it did not help. Seriously stumped.
    Any help is greatly appreciated.
    Here is my code for the dropdown.
    ++++++++++++++++++++++++++++
    topmostSubform.Page1.JobSelect::initialize - (JavaScript, client)
    var sDataConnectionName = "BBCC"; // example - var sDataConnectionName
    = "Test";
    var sColHiddenValue = "ContractAdmin_Key"; // example - var
    sColHiddenValue = "Dept_ID";
    var sColDisplayText = "JobDescription"; // example - var
    sColDisplayText = "Dept_ID"
    // Search for sourceSet node which matchs the DataConnection name
    var nIndex = 0;
    while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
    nIndex++;
    var oDB = xfa.sourceSet.nodes.item(nIndex);
    oDB.open();
    oDB.first();
    // Search node with the class name "command"
    var nDBIndex = 0;
    while(oDB.nodes.item(nDBIndex).className != "command")
    nDBIndex++;
    // Backup the original settings before assigning BOF and EOF to stay
    var sBOFBackup =
    oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");
    var sEOFBackup =
    oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF",
    "bofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF",
    "eofAction");
    // Clear the list
    this.clearItems();
    // Search for the record node with the matching Data Connection name
    nIndex = 0;
    while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)
    nIndex++;
    var oRecord = xfa.record.nodes.item(nIndex);
    // Find the value node
    var oValueNode = null;
    var oTextNode = null;
    for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)
    { if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)
    { oValueNode = oRecord.nodes.item(nColIndex); } else
    if(oRecord.nodes.item(nColIndex).name == sColDisplayText) { oTextNode
    = oRecord.nodes.item(nColIndex); } }
    while(!oDB.isEOF())
      this.addItem(oTextNode.value, oValueNode.value);
       oDB.next();
    // Restore the original settings
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup,
    "bofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup,
    "eofAction");
    // Close connection
    oDB.close();
    ++++++++++++++++++++++
    Here is code for the refresh button
    +++++++++++++++++++++
    topmostSubform.Page1.Button27::click - (JavaScript, client)
    sourceSet.BBCC.requery();
    +++++++++++++++++++++

    pguerett wrote:
    The other thing that might be happening is a refresh issue on the DropDownList. Try adding the command xfa.layout.relayout() after the database connection has been closed.
    Paul
    Good catch Paul!  Would you believe that I have been trying to get this resolved for almost two years! Works perfect now.
    Thank you,
      - Eric

  • Document 4500016031   does not contain any selectable items

    Hi Friends,
    I am doing MIGO(godds receipt) and adopted following procedure for MIGO.
    ME5J----->(Entered my Proj. defn---> executed
    Select material T-20610.
    Click the "Assign automatically" pushbutton.
    Assign materials T-20620 and T-20630 the same way.
    Display the overview of the assignments and then create the purchase order.
    Click the "Assignments" pushbutton.
    The purchase requisitions are sorted in the overview according to their assignments. You can create new purchase orders by clicking the "Process assignment" pushbutton.
    Place your cursor on the line below vendor "C.E.B.".
    Click the "Process assignment" pushbutton.
    Confirm the first dialog box by clicking the "Continue" pushbutton.
    If another dialog box appears, click "New purchase order".
    The purchase order appears.
    On the left-hand side of the overview, select your three purchase requisitions and copy them to the purchase order.
    Click the "Copy" pushbutton.
    Save the purchase order.
    Click the "Save" pushbutton.
    The purchase order number appears in the status bar.
    Make a note of the order number:   ____4500016031________
    Now I got the PO as per above procedure Now While I am doing  MIGO---Goods receipt am getting the below message.
    Any pointers is appreciated and will be rewarded.
    Document 4500016031(PO)   does not contain any selectable items                                                                               
    Message no. M7064                                                                               
    Diagnosis                                                                               
    The document or document item entered cannot be adopted.                                                                               
    Possible reasons for this are:                                                                               
    o   The document items have already been processed                     
            (Suggest zero lines indicator set?).                                                                               
    o   the document items have been deleted or are blocked.                                                                               
    o   the document items have been created for a different plant.                                                                               
    o   (for reservations only) movements are not yet allowed for the      
            reservation items.                                                                               
    o   (for reservations only) the document items are retrograde components 
         of the order. These are posted using the order confirmations.                                                                               
    o   A confirmation must exist for the document items.                                                                               
    o   The document items must be released first.                                                                               
    o   The document is an R/2 document.                                                                               
    Procedure                                                                               
    Make sure your entries are correct.                                                                               
    o   If the system has already processed the total quantity, you can set  
         the Suggest zero lines indicator. The system will suggest the        
         quantity zero for the items that have already been processed.                                                                               
    o   If you have entered a particular item, cancel the item. If you do    
         not enter an item, the system searches all of the open items in the  
    o   If the document is a purchase order, production order or a            
         reservation, you can enter search criteria in the dialog box.         
         You access the dialog box by choosing Enter with reference on the     
         initial screen.                                                                               
    o   If the document is an SAP R/2 document, you have to cancel it         
         manually by entering the reversal movement type.                      
    Regards

    Hi
    Check item level Confirmation tab I think this PO is activated for Inbound delivery or Confirmation control
    vIVEK

  • Centro, set up , does zincronising is essential for centro to function, my receives calls but does not send

    my new centro seems to have a problem with set up.
    now the unit receives calls  but does not send ; does any one experienced a "se up" prolem?
    Post relates to: Centro (AT&T)

    If your are unable to send phone calls I would recommend that you contact your carrier about this. If you feel this is the device you can do a hard reset on it and before you sync try to place a phone call if that resolves the issue then go to your backup folder located here:
    XP
    C:\Program Files\Palm or Palm One\[hotsync username]\backup
    C:\Palm\[hotsync username]\backup
    C:\Program Files\Handspring\[hotsync username]\backup
    [Palm Desktop 6.2 only] My Documents\Palm OS Desktop\[hotsync username]\backup
    Vista
    Start-->Documents\Palm OS Desktop\[hotsync username]\backup
    Mac
    Macintosh HD : Applications : Palm : (Palm username) : Backup
    Macintosh HD : Users : (Mac username) : Documents : Palm : Users : (Palm username) : Backup
    And rename the backup folder to backupOld. Then sync. If this does not resolve the issue you may need to call the carrier to be sure that your SIM card and device is setup correctly.

  • I am using Illustrator CS5. I am using a certain font and when I make a selection to use one of the letter options or a glyph, it does not take my selection; in other words, nothing changes.

    I am using Illustrator CS5. I am using a certain font and when I make a selection to use one of the letter options or a glyph, it does not take my selection; in other words, nothing changes.

    What font? What system? What Glyph? What language settings? Could be anything. Either way, ask in the AI forum. You'll get quicker answers there - if you provide all the required info.
    Mylenium

  • Migo cannot be done " PO does not contain any selectable items"

    Dear SAP Gurus
    We have a very urgent issue, while trying to do MIGO for a particular standard PO.
    Some down payments have been done to this PO already and now when we try to do the MIGO, system is giving the error "PO does not contain any selectable items"
    The accounting document which is created when the down payment is done can be seen in the purchase order History.
    Please suggest soem solution
    Thanks
    kk

    Hi Kavitha,
    Please check whether all the po item quantities are received. If any open line items are there then go to item detail po tab in that Select Confirmation Tab and Check whether the confirmation is Z001. Change it to 0001 etc and save.
    Try this, if unresolved revert back.
    Reg,
    Ashok
    Assign points if useful.

  • Under bookmarks the Organize bookmark option does not appear, new computer Firefox 4.0, and Windows 7, how to make it appear, thanks

    Under bookmarks the Organize bookmark option does not appear, new computer Firefox 4.0, and Windows 7, how to make it appear, thanks

    "Organize Bookmarks" has been renamed to "Show All Bookmarks" in the bookmarks menu.

  • J1IEX post than made error like does not contain any selectable items

    Respected Sir,
    We have purchase the Goods From SEZ unit and it wil be treated as import made.
    We doing the following activities
    1. Prepared the Import P.O.
    2. released the same P.O.
    3. Doing the MIRO for Custome Vendor
    4. Capture the J1iex
    than we fins the below mention ERROR & Diagnoses and ERROR
    Document 4400000016   does not contain any selectable items
    Message no. M7064
    Diagnosis
    The document or document item entered cannot be adopted.
    Possible reasons for this are:
    u2022     The document items have already been processed
    (Suggest zero lines indicator set?).
    u2022     the document items have been deleted or are blocked.
    u2022     the document items have been created for a different plant.
    u2022     (for reservations only) movements are not yet allowed for the reservation items.
    u2022     (for reservations only) the document items are retrograde components of the order. These are posted using the order confirmations.
    u2022     A confirmation must exist for the document items.
    u2022     The document items must be released first.
    u2022     The document is an R/2 document.
    Procedure
    Make sure your entries are correct.
    u2022     If the system has already processed the total quantity, you can set the Suggest zero lines indicator. The system will suggest the quantity zero for the items that have already been processed.
    u2022     If you have entered a particular item, cancel the item. If you do not enter an item, the system searches all of the open items in the document.
    u2022     If the document is a purchase order, production order or a reservation, you can
    Kindly doneedfull above mention error
    Thanks & Regards
    Bipin Shah

    HI,
    Please check whether all the vendor and excise details have been maintained in J1id.  i.e Excise rate maintainance.
    Hope this helps.
    Regards,
    Prasanna
    Award pls if helpful

  • Business Management Error: You are attempting to create a user with a domain logon that does not exist. Select another domain logon and try again.

    Hello,
    Suddenly the working CRM is being stopped for some group of users.
    I drilled down to the issue and have checked that the users from Domain in which CRM is installed are having CRM access.
    But for other domain user having problem to access CRM.
    I tried to add a user from a domain which is not of CRM domain then it gives following error.
    "Business Management Error: You are attempting to create a user with a domain logon that does not exist. Select another domain logon and try again.
    <Message>LookupAccountNameW failed with error</Message> "
    The change is made - AD group have upgraded Activer Directory server to 2012 R2
    Please help as the Production CRM is not working for other domain user.

    We have Activer Directory Structure like below.
    One Root Domain says A
    and there are multiple child domain like B,C,D etc...
    B,C and D are all in same level,they are child of A domain.
    There are two way transitive trusts between A and all the child Domain.
    But there is no trust in between B and C and so on.
    Our CRM server is in B domain and B domain's user can access CRM but users of Domain C,D and so on can not access CRM.
    If this post answers your question, please click &quot;Mark As Answer&quot; on the post and &quot;Mark as Helpful&quot;

  • Call Blocking does not. Is this just a scam too?

    Verizon call blocking is a useless 'service', dozens of calls come through with no phone number at all on the caller ID, something Verizon specifically states it will NOT DO.  Any ideas?
    Verizon call blocking does not address scammers and money-seekers who have caller ID of "Not-Available' -- honestly my dog could figure out how to block these but Verizon cannot. Besides paying more money to someone else, is there any hope for the people who expected the Verizon service would work?

    Scam no.  A service that needs to be update to the 21th Century, yes.  Still based on early callerid tecnhnology which is easily bypassed by all those so called "telemarketers" .   You should have now trouble with ligitimate callers, but lots of illegal calls come in.

  • [svn] 3668: Fix for SDK-15941: selectedItem/ selectedIndex does not render as selected.

    Revision: 3668
    Author: [email protected]
    Date: 2008-10-15 15:25:04 -0700 (Wed, 15 Oct 2008)
    Log Message:
    Fix for SDK-15941: selectedItem/selectedIndex does not render as selected.
    Reviewer: Deepa
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15941
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as

    This bug figures out also when creating a custom spark ComboBox, then trying to programatically update the userProposedSelectedIndex property. The proposed selected index is selected, but does not apply the same skin as when mouse is on rollover or item is selected due to up and down keys.
    The issue seems like updating the status of the item renderer to rollover or selected to get the same skin applied.
    Please could you attach DropDow nList.as that you edited ?
    Thank you so much.

Maybe you are looking for

  • Case statement and Decode function both are not working in Select cursor.

    I have tried both the Case statement and Decode function in Select cursor, but both the things are not working. On the other hand both the things work in just select statement. See the first column in select (PAR_FLAG), I need to have this evaluated

  • How to make settings of root folder , while creating customize JSP Pages.

    Hi All, I am developing customized BI Beans Application.While the development ,I gose to compnent pallete and try to access BI Beans Objects which are on same workspace . But in the location tab it shows root foloder and only one object . I am unable

  • Can't draw a line HELP!

    I have to do something really quick in Illustrator. But every time I draw a new line the last line disappears!! Whether I use the brush or the pencil. If I concentrate real hard and draw in super slow motion, I can get it to not disappear. BUT then w

  • Unable to add AD user or group in app-v 5.0 management console

    Hi, I am doing POC of app-v 5.0 at customer's environment. I did the testing of app-v 5.0 in my test lab environment and its working fine but at customer environment I am getting below error in app-n management console. Invalid input was passed. Ther

  • Safari crashes when trying to download

    I'm running Safari 3.0.4 on my PowerBook G4 running OS 10.4.11. Every time I try to download a file it crashes. Otherwise it seems to be running fine. The only 3rd party plug-in I'm using is Safari Stand. I'm using the latest version of it and I'm us