|
rookie (m)
|
*Just to clarify -- you do NOT have a bug; you only need a little help
However, It's a little hard to help you in this case since I cannot see the code. First, what kind of applet are you working on? is it a jApplet? From your post I suspect that you might be a little new to Java. The easiest and fastest way to get help online is to search for tutorials on line. You will find tutorial online on almost every topic.
But if my assuption about your experience with Java is wrong then, you might find this a little useful:
=========================================== String[] items = {"item1", "item2"};
JComboBox cb = new JComboBox(items);
// Add an item to the start of the list cb.insertItemAt("item0", 0); // Add an item after the first item cb.insertItemAt("item0.5", 1); // Add an item to the end of the list cb.addItem("item3"); // Remove first item cb.removeItemAt(0); // Remove the last item cb.removeItemAt(cb.getItemCount()-1); // Remove all items cb.removeAllItems(); ==========================================
Assuming you are using a JComboBox as your dropdownlist, this should do the trick for you: cb.removeAllItems(); - It removes all items from the combobox.
Since you are working with a data file, you will need to read the data from the file, and add them to the combobox. You can get help from this link: http://www.devdaily.com/java/edu/pj/pj010004/pj010004.shtml or better still, you can always search on google for more help
|