Code example for JList

Methods: getModelsetModel

0
   * 
   * @param exp a value of type 'Experiment' 
   */ 
  public void setExperiment(RemoteExperiment exp) {
    m_Exp = exp;
    m_List.setModel(m_Exp.getRemoteHosts());
    if (((DefaultListModel)m_List.getModel()).size() > 0) {
      m_DeleteBut.setEnabled(true);
    } 
  } 
 
  /** 
   * Handle actions when text is entered into the host field or the 
   * delete button is pressed. 
   * 
   * @param e a value of type 'ActionEvent' 
   */ 
  public void actionPerformed(ActionEvent e) {
    if (e.getSource() == m_HostField) {
      ((DefaultListModel)m_List.getModel())
Contextual code suggestions in your IDE  Get Codota for Java