Code example for JList

Methods: setSelectedValue

0
            !StringUtils.isEmpty(connectionDefinition.getName()))
        { 
          // A new JNDI source was created 
          dialogModel.createDatasource(connectionDefinition);
          dataSourceModel.addElement(connectionDefinition);
          dataSourceList.setSelectedValue(connectionDefinition, true);
        } 
      } 
      catch (XulException e1)
      { 
        UncaughtExceptionsModel.getInstance().addException(e1);
      } 
    } 
  } 
 
  private EditDataSourceMgmtService dialogModel;
  private JList dataSourceList;
  private EditorComboBoxModel dataSourceModel;
 
  public ConnectionEditorPanel()