Archived

This topic is now archived and is closed to further replies.

pdstatha

Java question, plz answer.

Recommended Posts

pdstatha    122
I''ve got a slight overflow problem here, can anyone explain this, cos I can''t figure it out!!! ListDemo2.java
if(event.getSource() == deleteButton) {
	    k = list.deleteMultiple();
	    showList(list);  // if I were to comment out this line then the overflow problem does not occur, except it won''t display the updated list correctly
	    showMessage("deleted " +k + " duplicate items");
            	            } 
void showList(ListByVector list)    {
	int	i = scrollbarPos; 
       int	n = list.size();
	int     c = 0;
        i = i * numCol;	
while((i < n) && (c < maxDisplay)) {
	    itemLabels[c].setVisible(true);
	    itemLabels[c].setText(list.item(i));
	    i++; c++;
	}	
while(c < maxDisplay) {
	    itemLabels[c].setVisible(true);
	    itemLabels[c].setText("");
	    c++;
	}	// clear input text field
	userInput.setText("");
    } 
ListByVector.java public int deleteMultiple() { m = 0; for(int i=0; i

Share this post


Link to post
Share on other sites