DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Handling events

  1. #1
    Join Date
    Feb 2006

    Handling events

    what is the code for clearing the list in java Applet programming using ItemListener method?

  2. #2
    Join Date
    Mar 2004
    ummm, what?

  3. #3
    Join Date
    Feb 2006
    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

  4. #4
    Join Date
    Feb 2006

    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

  5. #5
    Join Date
    Mar 2004
    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

  1. Replies: 0
    Last Post: 02-20-2005, 01:06 PM
  2. Handling and Raising events
    By Kent in forum Java
    Replies: 3
    Last Post: 12-02-2002, 05:48 PM
  3. ASP.NET Community Events Calendar
    By ASPSmith Training in forum dotnet.announcements
    Replies: 0
    Last Post: 06-14-2002, 07:39 PM
  4. COM Interop and Events.
    By Dave in forum .NET
    Replies: 0
    Last Post: 05-15-2002, 09:21 AM
  5. Com+ Events
    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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.