Hi All,
I developed an application (JFrame) to connect to mysql database. The
application will select price from itemsTable and add each each item
to a JComboBox. If the user change the prices in the database tabl,
he/she should press a button in the application to reload the prices
from the database.
Once the user clicks the buttons, it removes all the items, using
removeAllItems(), from the JComboBox then add the new prices.
It works fine in windows 2k but when I run it in WinXP, the items are
not removed. It appends to the existing items. It also, remove the
drop down arrow ( the arrow that you click to view all the items).
part of the code that does the addition and removals is:
flowerJButtons.reloadItems().addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
itemsPrices=flowerGetAllItems.callGetItem();
itemsExist.removeAllItems();
pricesExist.removeAllItems();
items.removeAllItems();
prices.removeAllItems();
prices.addItem("Price");
pricesExist.addItem("Price");
items.addItem("Choose an item");
itemsExist.addItem("Choose an item");
for(int i =0;i<itemsPrices.length;i++)
{
prices.addItem(itemsPrices[1][i]);
items.addItem(itemsPrices[0][i]);
pricesExist.addItem(itemsPrices[1][i]);
itemsExist.addItem(itemsPrices[0][i]);
}
}
}
);
Thank you in advance