-
Handling events
what is the code for clearing the list in java Applet programming using ItemListener method?
-
-
well see,in a program i have taken two combo box,one is for Country and another is for cities of the respective country.lets say for India i have taken four cities.while i m choosing India the four cities are automatically getting displayed as i have used ItemListener method but as many times i m selecting India the cities are getting added.can you please tell me why is it happening so?means i need to give a command for clearing the list in the combobox.if you need i will post the codes.
respond me please
-
Hi,
so the problem is when you select India on country box, you see cities getting populated; but if u select India once more you see the city list getting Appened to the list again?
and please post the code that wud be helpful
-
How are you storing the list data for the comboBox? If you're using a Vector, you can call Vector.clear() then add your cities to it. Then I believe calling JComboBox.validate() will update the display with the new values.
Similar Threads
-
By Prometheus in forum Java
Replies: 0
Last Post: 02-20-2005, 01:06 PM
-
Replies: 3
Last Post: 12-02-2002, 05:48 PM
-
By ASPSmith Training in forum dotnet.announcements
Replies: 0
Last Post: 06-14-2002, 07:39 PM
-
Replies: 0
Last Post: 05-15-2002, 09:21 AM
-
By Faisal in forum VB Classic
Replies: 0
Last Post: 10-18-2000, 01:47 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks