How to select multiple nodes, which are not next to each other,  in a tree?

The following code suppose to allow user select any combination of nodes (because of DISCONTIGUOUS_TREE_SELECTION), however, I can only select nodes which are next to each other. Can some one told me how to make this DISCONTIGUOUS_TREE_SELECTION work?
Thank you very much!
import javax.swing.*;
import javax.swing.tree.*;
public class TestTree extends JFrame {
public TestTree() {
super();
setBounds(0,0,500,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTree tree = new JTree();
getContentPane().add(tree);
TreeSelectionModel model = new DefaultTreeSelectionModel();
model.setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
tree.setSelectionModel(model);
public static void main(String [] args) {
TestTree test = new TestTree();
test.show();

In Windows you hold down the Ctrl key while clicking on the nodes you want to select. Don't know the equivalent in other environments.

Similar Messages

  • With a wired keyboard and a 2014 iMac I cannot select multiple items which are not next to each other

    I have recently changed from Windows 7 desktop to a new iMac running Mavericks.  I have chosen a wired keyboard as I like  the usual Delete key function.
    I cannot find out how to select several items which are not next to each other (e.g. words in Pages).  The well known method in Windows, which is repeated in the the Apple Finder Help screen, does not work.  Would be grateful for advice

    Hi JBowfin,
    If I am understanding your question correctly, I believe that I have an article that will address this question for you:
    Mac OS X 10.0: Use Command Key to Select Multiple Items in List and Column Views
    http://support.apple.com/kb/TA20396
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • How exclude multiple values which are not in sequence ( range )

    Hi Abapers,
    My Requiremnt is to exclude multiple values which are not in sequence  in selection screen.
    I want to restrict some values .
    please provide sample code.
    thanks & regards,
    Hari priya

    SELECT-OPTIONS : s_matnr FOR mara-matnr.
    INITILIZATION.
    s_matnr-sign = 'E'.  " E means Excluding.
    s_matnr-option = 'EQ'.
    s_matnr-low = '1000'.
    append s_matnr.
    s_matnr-sign = 'E'.
    s_matnr-option = 'EQ'.
    s_matnr-low = '1500'.
    append s_matnr.
    s_matnr-sign = 'E'.
    s_matnr-option = 'BT'.
    s_matnr-low = '2000'.
    s_matnr-high = '3000'.
    append s_matnr.
    START_OF_SELECTION.
    SELECT * FROM MARA INTO TABLE itab WHERE mara IN s_matnr.
    the above s_matnr has values 1000,1500, 2000 - 3000.
    so the above code fetches all the values excluding 1000,1500 and between 2000 and 3000.
    Regards
    Bala Krishna

  • The selected remote nodes 'node3' are not accessible

    Hello,
    I removed node3 from 2 node RAC Cluster.
    After this I have re-add this node to my RAC. I added without any problem to CRS but I have a problem with script addNode.sh (/u01/app/oracle/product/crs/oui/bin).
    I have to separate homes for ORACLE_HOME and ASM_HOME, so I need to run this script twice for each ORACLE_HOME.
    I run addNode.sh from one of the cluster nodes (node1), if I run:
    export ORACLE_HOME=/u01/app/oracle/product/11.1.0/asm
    cd $ORACLE_HOME/oui/bin
    ./addNode.sh -silent CLUSTER_NEW_NODES={node3} CLUSTER_NEW_PRIVATE_NODE_NAMES={node3-priv} CLUSTER_NEW_VIRTUAL_HOSTNAMES={node3-vip}
    I got the following error:
    Performing tests to see whether nodes node2,node3 are available
    ............................................................SEVERE:The selected remote nodes 'node3' are not accessible.
    ... 100% Done.
    I reviewed logs located in /u01/app/oraInventory/logs I found
    Status of node 'node3':
    null
    The virtual host name 'node3-vip' for node 'node3' is already in use.
    I checked crs_stat from $ORA_CRS_HOME, but all applications (ons, gsd, vip) and targets are ONLINE. I tried to run vipca -nodelist node1,node2,node3 and updated a configuration. I checked /etc/hosts, connection via SSH between all hosts belonging to RAC: node1, node1-vip, node1-priv etc. Everything looks like fine, so I have no idea what caused this problem.
    Software which I used:
    Linux: UNL 5.4 x86_64
    11g Release 11.1.0.7.0 - 64bit, Oracle Clusterware
    Thank you for your answer,
    Best Regards,
    Edited by: user4924714 on 2010-02-15 07:50

    Hi,
    Thanks for your reply.
    I am running addNode.sh from node which already exist in the Rac Cluster. I tried on node1, node2 but the resulat are the same.
    Best regards,

  • Xml nodes which are not meet the schema validation

    Hi All,
    Is there way to keep xml nodes which are not meet the schema validation ,so that i can send those failed records back to the Source Target.
    I thought to implement to adding validate in the ForEach loop.Any hints

    In Windows you hold down the Ctrl key while clicking on the nodes you want to select. Don't know the equivalent in other environments.

  • How can i send videoes which are not in camera roll via whatss app to others ?

    hi,
    I am going to know that how can i transfer video which are not in camera roll via whatss app to others ?
    thnaks in advanced.

    Where are the videos?
    If WhatsApp supports sending videos from the Camera Roll only and that is your only option, that is it.
    Contact WhatsApp. They have a website.

  • How to remove the tasks which are not manually recoverable?

    How to remove the tasks which are not manually recoverable?
    I tried performing manual recovery for the BPEL processes but there are few tasks which cant be manually recoverable..
    Could you please tell me how to remove those tasks and also tell me which information in the console is the task_id in the database?

    This article explains how to cleanup bpel process instances, you can find task instance id by searching for data in payload using api.
    Managing a BPEL Production Environment
    http://www.oracle.com/technology/pub/articles/bpel_cookbook/blanvalet.html
    Cheers,
    Rad

  • Setting bold font for nodes which are not leaf nodes

    In JTree, is it possible to set the font for nodes which are not leaf nodes. Can I do this without using custom renderer, or at the most using a DefaultTreeCellRenderer ?
    regards,
    nirvan

    In JTree, is it possible to set the font for nodes which are not leaf nodes. Can I do this without using custom renderer, or at the most using a DefaultTreeCellRenderer ?
    regards,
    nirvan

  • How can I detect workbooks which are not longer in use?

    Hello togehter,
    I am looking for a way to detect BEX Workbooks which are not longer in use. Is there something in the BC which I can use for that?
    Best would be some query with the information of when and by whom a workbook gets called up last time.
    Thanks!
    Andreas

    Hi Edward,
    there is no key figure providing this information.
    First of all you got convert the 0CALDAY from Date to Number, therefore you got to configure a new variable (by replacement path) and put it into a formula.
    Use the result of this formula as a column and create a new TOP 1 condition on it.
    Now you will only get one row per Workbook/Query (or whatever you have chosen) with the date of the last use of it.
    Regards,
    Andreas

  • How to Show All Packages, That are not required by any other package

    I need a way to see al the installed packages thar are not required by any other package
    Thanks in advance ...

    You probably want pacman -Qt or pacman -Qdt
    Check out man pacman.

  • Two separate iPhones got merged into one iTunes account. How to separate them. We are sharing all of each other's contacts at this time. Thanks for your help.

    Two separate iPhones got merged into one iTunes account. How can I separate them in iTunes???????. We are sharing all of each other's contacts at this time. Thanks for your help.

    The reason you are receiving each other's text messages is because you are both using the same Apple ID for iMessage.  To prevent this you need to use different IDs.  (Note: you can still share the same ID for iTunes.)  On one of the phones, go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign back in with a separate ID.
    To migrate your 3GS to a new iCloud account, start by saving any photo stream photos that you want to keep on the phone to your camera roll.  To do this, open the my photo stream album, tap Edit, tap the photos, tap Share, tap Save to Camera Roll.  Next, if you have any notes that you are syncing with iCloud that you want to keep, you'll need to email these to yourself so they can be recreated after moving to the new account.
    Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from this phone, not from iCloud.  The phone that will be keeping the account will not be effected by this.)  When prompted about what to do with the iCloud data, choose Keep On My iPhone.  Next, sign back in with a different Apple ID to create the new account, turn iCloud data syncing preferences and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.
    Finally, if you have merged data in the two accounts that you want to separate you will have to go to icloud.com from your computer, sign into each iCloud account separately and manually delete the data you don't want from each account.

  • NetWeaver XI components are not talking to each other

    I am an XI  consultant, i dont have proper Basis support at my client, since they are fond of only ABAP stack.
    They installed netweaver xi from the market place.
    I am unable to import any SWCV (even SAP BASIS) from SLD to IR and IR menu is blank.
    Unable to find list of adapters in Integration Directory.
    RWB -component monitoring is blank .
    SLD- creation of products,SWCV,Technical Sys,Buss Sys is possible.
    In conclusion i can say that they all are not co-operative and not talking to each other
    And also i want to know wheather xi 7.0 is compatable to databases Oracle 8.0.3 and Oracle 8.0.4

    Hi Venkata,
    Does the XI post Installation steps done by the team or not? It seems that there is some steps missing while doing the XI installation. Talk to to the BASIS team and tryu to find out the solution.
    >>> Unable to find list of adapters in Integration Directory.
    Check thisblog for it:
    /people/venugopalarao.immadisetty/blog/2007/03/15/adapter-engine-cannot-be-found-in-integration-directory
    >>> And also i want to know wheather xi 7.0 is compatable to databases Oracle 8.0.3 and Oracle 8.0.4
    In my view, yes. XI is compatible with all the versions of Oracle Database above version 8 but never tried it.
    Reward points if helpful. *
    Regards,
    Subhasha Ranjan

  • Booklet with pages one above the other, not next to each other

    I have sheets of paper that is 13cm wide and 20cm tall. It is perforated in the middle.
    When I go to File | Booklet in InDesign CS4 I setup a booklet which tries to print 2 pages next to each other but of course these it not enough room.
    What I need to do is have the two pages be one above the other to fit on the sheet of paper. But I am unable to find a way to do that.
    Any hints?
    Thanks!

    in the print dialog you can change the parameters
    for output in the 'setup' section--see screenshot--width, height, orientation, page position
    see this linked page:
    http://www.thebookdesigner.com/2009/11/creating-a-pdf-for-lightning-source-in-indesign-par t-3/

  • Both my pc and android phone are synced to Firefox, but the devices are not syncing with each other

    Each device (pc + android phone) is logged into Sync, but there is no sync sharing happening
    <sub>edit: removed personal information for your protection. (philipp)</sub>

    HI msknack,
    Thank you for your question. I understand that both of the devices are not syncing to match. Can you please check the following:
    *Are they on the same version of sync? (Android account should not list Firefox Sync (deprecated))
    *Are the managed items checked to be synced in the sync options?
    Posting back could help out other users as well.

  • Ios phone and Ipad are not syncing with each other

    Both devices are set up to sync with same icloud account. ios phone is sending imessages from my email address, and when i try switching it in settings, it wont appear on my ipad messages stream. 
    Logged on to my iclous account and none of my phots/info is appearing there.  made sure it is all set up to be backed up to icloud, but still not there/  It seems like the devices are not communicating with icloud...

    HI msknack,
    Thank you for your question. I understand that both of the devices are not syncing to match. Can you please check the following:
    *Are they on the same version of sync? (Android account should not list Firefox Sync (deprecated))
    *Are the managed items checked to be synced in the sync options?
    Posting back could help out other users as well.

Maybe you are looking for