+2  A: 

In this section:

ResultSet r=bq.executeQuery("select productID,productName from products");
cmbProductID.removeActionListener(this);
cmbProductID.removeActionListener(this);

I think you mean:

ResultSet r=bq.executeQuery("select productID,productName from products");
cmbProductID.removeActionListener(this);
cmbProductName.removeActionListener(this);

Otherwise there's an event handler left open on cmbProductName that will leak memory.

Nick Craver
Thank you Nick. I found the problem It's the SwingX library.AutoCompleteDecorator.decorate(cmbProductID);AutoCompleteDecorator.decorate(cmbProductName);
Thihara
+2  A: 

There are two problems that I see. @Nick Carver pointed one out (+1). If you dont remove the ActionListener from cmbProductName as you no doubt intended, you will be propagating action events from that combo on every iteration over your ResultSet.

The second is that you appear to be doing some heavy lifting in your painting thread. Your db calls should in general be made in a worker thread, and only the tasks that paint the gui be made in the painting thread. Otherwise you will be blocking this thread and your application will feel sluggish. Look at SwingWorker and concepts around concurrency in Swing for more info on this topic.

akf
Thank you akf. I found the problem It's the SwingX library.AutoCompleteDecorator.decorate(cmbProductID);AutoCompleteDecorator.decorate(cmbProductName);And I wasnt aware of the SwingWorker and related methodology/ i will look into it...
Thihara