private DefaultListModel<String> getFriendsToDisplay() {
	  String searchText = searchTextField.getText().trim();
    if (searchText.isEmpty()) {
      if (showOnlineFriends) {
        onlineFriendsLabel.setText(ONLINE_FRIENDS);
        return friendsListModel.getOnlineFriendsNames();
      }
      else {
        onlineFriendsLabel.setText(ALL_FRIENDS);
        return friendsListModel.getAllFriendsNames();
      }
    }
    else{
    	if(showOnlineFriends){
    		return friendsListModel.selectOnlineFriendsFromList(searchText);
    	}
    	else{
    		return friendsListModel.selectAllFriendsFromList(searchText);
    	}
    }
  }