
hi i have developed a form and i have jcombobox in which data is retrieved from ms access but the problem is that if we pressed the down key the last 5 data are not showed only the other data can be pressed and no other.plzz help.

Here is an example that retrieves data from database and add it to jcombobox using java swing.
import java.sql.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class AddComboBoxItem{
AddComboBoxItem(){
JComboBox combo=new JComboBox();
JFrame f=new JFrame();
JPanel p=new JPanel();
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:access");
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("Select coursename from course");
while(rs.next()){
combo.addItem(rs.getString("coursename"));
}
}
catch(Exception e){}
p.add(combo);
f.add(p);
f.setVisible(true);
f.setSize(300,100);
}
public static void main(String[] args)
{
AddComboBoxItem add=new AddComboBoxItem();
}
}

but in this while pressing the down key it goes only till the 5th value and then it comes back to the 3rd value..all the 10 fields are displayed but it can go only till 5th value while pressing down key..
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.