Array duvida

boa noite pessoa sou novo aki e no mundo da programação, estou tentando fazer um sistema para dar um select no banco, ate hai ja esta tudo certomporem estou com uma duvida que não sei como resolver preciso pegar um valor que esta alocado em um posição do array não sei como posso fazer isso, vou postar o codgo

public class tela extends javax.swing.JFrame {

private ArrayList<String> VEI_ID = new ArrayList<String>();  
private ArrayList<String> VEI_PLACA = new ArrayList<String>();  


/** Creates new form tela */
public tela() {
    initComponents();
    
}

/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">                          
private void initComponents() {

    jButton1 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jButton1.setText("jButton1");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
        .add(layout.createSequentialGroup()
            .add(129, 129, 129)
            .add(jButton1)
            .addContainerGap(174, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
        .add(layout.createSequentialGroup()
            .add(99, 99, 99)
            .add(jButton1)
            .addContainerGap(172, Short.MAX_VALUE))
    );

    pack();
}// </editor-fold>                        

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         

   Statement stmt =  Conexao.get();
   String sql = "SELECT udl.VEI_ID, udl.UDL_DH, v.CLI_ID, v.VEI_COD, v.VEI_PLC FROM arenateste.ult_dado_lido AS udl INNER JOIN veiculo AS v ON v.VEI_ID = udl.VEI_ID AND udl.UDL_DH < (NOW()- INTERVAL 5 DAY) ORDER BY udl.UDL_DH";
    try {
        ResultSet rs = stmt.executeQuery(sql);
        
        while (rs.next()) {
            this.VEI_ID.add(rs.getString("VEI_PLC"));
            System.out.println(VEI_ID);// [b]aki estou tentando mostra o que tem no array (vou posta o resultado embaixo) [/b]
            
        }
      
    } catch (SQLException ex) {
        Logger.getLogger(tela.class.getName()).log(Level.SEVERE, null, ex);
    }
            
}                                        

/**
 * @param args the command line arguments
 */
public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {

        public void run() {
            new tela().setVisible(true);
        }
    });
}
// Variables declaration - do not modify                     
private javax.swing.JButton jButton1;
// End of variables declaration                   

}

Resultado

[]
[, ]
[, , ]
[, , , ]
[, , , , NNK-1483]
[, , , , NNK-1483, MYL-4213]
[, , , , NNK-1483, MYL-4213, MYP - 4828]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, ]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340, MXM-9575]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340, MXM-9575, MYN-0681]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340, MXM-9575, MYN-0681, MXP-1877]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340, MXM-9575, MYN-0681, MXP-1877, MZE-7908]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340, MXM-9575, MYN-0681, MXP-1877, MZE-7908, MZE-7918]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340, MXM-9575, MYN-0681, MXP-1877, MZE-7908, MZE-7918, HUQ-9112]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340, MXM-9575, MYN-0681, MXP-1877, MZE-7908, MZE-7918, HUQ-9112, MXU-4388]
[, , , , NNK-1483, MYL-4213, MYP - 4828, HUL - 6158, MYP-5907, MYL-6369, NNM-4487, , MZC-0340, MXM-9575, MYN-0681, MXP-1877, MZE-7908, MZE-7918, HUQ-9112,
[

Use um laço de repetição para acessar cada posição do seu array.
Sobre o seu código, sempre que postar código, use as tags code.

Abraços.

bom dia obrigado pela dica, vou tentear usar um FOR e desculpa por posta o codgo assim vou tentar om um for usando um .get(i)

Podes usar o “foreach”. Veja exemplo:

//Suponha que listInteger seja uma lista já populada de Wrappers do tipo Integer (Integer value : listInteger) { System.out.println("Valor: " + value); }

É o mesmo que se fizesse:

for (int index = 0; index < listInteger.size(); index++) { System.out.println("Valor: " + listInteger.get(index)); }

Abraços.

so mais uma duvida

eu devo usar o for dentro deste while que uso para preencher o array ?

[quote=j.amarorn]so mais uma duvida

eu devo usar o for dentro deste while que uso para preencher o array ?[/quote]

O que você acha? Não né?
Você está utilizando um laço de repetição para popular um array e só. Você pode exercer outras funções dentro dele, caso julgue necessário.
Obviamente, você pode simplesmente a cada valor recuperado do banco mostrar no console, algo como:

while (rs.next()) { String vei_plc = rs.getString("VEI_PLC"); System.out.println(vei_plc); this.VEI_ID.add(vei_plc); }

Isso simplesmente iria mostrar valor a valor que esteja vindo do banco de dados. Todavia, se queres apresentar de outra forma que não seja via console e em outro local do seu código, precisas de um novo laço. Se fizer outro laço dentro desse para mostrar o conteúdo, teria uma logica do tipo:

(Primeira iteração) - Mostra posicao 1
(Segunda iteração) - Mostra posicao 1, 2
(Terceira iteração) - Mostra posicao 1, 2, 3

E eu acredito que tu queira mostrar tudo de uma vez só, ou seja:

1, 2, 3, 4, 5…e não 1, depois 1 e 2, depois 1, 2 e 3…certo ?
Abraços.