So I have the following code which executes when a button is pressed. I have designed the rest of the GUI using the GUI builder within Netbeans.
private void populateBtnActionPerformed(java.awt.event.ActionEvent evt) {
String query = "SELECT AccNo from accounts";
try{
connect.rs = connect.st.executeQuery(query);
Vector<String> temp = new Vector<String>();
while (connect.rs.next()){
temp.add(connect.rs.getString("AccNo"));
}
JList accList = new JList(temp);
jPanel4.add(accList, BorderLayout.CENTER);
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
}
Why wont the list box show up? What am I doing wrong?
Thank you in advance.