Olá, estou com um projeto em java e estou usando um ListView para exibir uma lista de Interno:
<strong>1. private ListView ListInterno;</strong>
**2. **
<strong>3. private final List ListInte = new ArrayList<>(iDAO.relatorioGeral());</strong>
**4. **
<strong>5. private ObservableList ObserInte;</strong>
<strong>1. public void CarregarInterno(){</strong>
<strong>2. ObserInte = FXCollections.observableArrayList(ListInte);</strong>
**3. **
<strong>4. ListInterno.setItems(ObserInte);</strong>
**5. **
<strong>6. }</strong>
Porém como estou pegando as informações do Banco de dados, peço um relatório:
<strong>1. public ArrayList relatorioGeral(){</strong>
<strong>2. ArrayList lista = new ArrayList<>();</strong>
**3. **
<strong>4. try{</strong>
<strong>5. minhaConexao.conectar();</strong>
<strong>6. Statement instrucao = minhaConexao.getConexao().createStatement();</strong>
<strong>7. ResultSet rs = instrucao.executeQuery(RELATORIOGERAL);</strong>
<strong>8. while(rs.next()){</strong>
**9. **
**10. **
<strong>11. Interno i = new Interno(rs.getString(“Matricula”), rs.getString(“Nome”), rs.getString(“Quarto”), rs.getString(“Cidade”), rs.getString(“CPF”), rs.getInt(“Idade”));</strong>
<strong>12. lista.add(i);</strong>
<strong>13. }</strong>
<strong>14. minhaConexao.desconectar();</strong>
<strong>15. }catch(SQLException e){</strong>
<strong>16. System.out.println("Erro no Relatório Geral: "+e.getMessage());</strong>
<strong>17. }</strong>
<strong>18. return lista;</strong>
<strong>19. }</strong>
Mas eu só quero exibir o Campo/Atributo “Nome”, mas quando vejo no ListView fica assim:
Por favor, me ajudem…

**