w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Data Structure that works similar to JList in java swings for using in java FX

I tried working with List view. Its working fine.For selecting a particular value on the list view and getting its index, I used the following code snippet.

   public ListView<String> jlstDefects ;
   public TextField fldDefectName;

   private void jltDefectsListItemSelected()

    int ndx = jlstDefects.getSelectionModel().getSelectedIndex();
    if (ndxJlstDefectSelector == ndx)
    ndxJlstDefectSelector = ndx;
    String strSelectedDefectName = lstDefectList.getDefect(ndx);


I have assigned the item which I got from the list view to a text field in my application. Thanks for the suggestions provided.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.