i have written the following code, my 1st combo box getting the write data but when i have problem in the getting the data in 2nd combo box when i select from the 1st one....kindly help me....advance thnx for answering

String obj =(String)jComboBox1.getSelectedItem();
res=stat.executeQuery("Select flight from main where Route="+obj);
String [] array2=new String[5];
for(int i=0;res.next();i++)
array2=res.getString(2);
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(array2));

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.