Results 1 to 3 of 3
  1. #1
    ankitmcgill is offline Member
    Join Date
    Nov 2008
    Posts
    22
    Rep Power
    0

    Default n00b: linked list question

    In my application I have a linked list containing object references to all the buttons in the window.

    the user can create/destroy buttons and i need to update the list accordingly.

    now my question is in my present setup, when a user destroys a button i would have to :

    1. traverse through the list to get the refernce of each button
    2. check the string of the button to see if it matches to the button that has been destroyed.
    3. if it matches, remove that from the list else continue.

    now is there any data structure that would allow me to reference the button in the list using the button string as the index to allow me to do a direct search ?

    thank you for the help
    -ankit

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    You could use a HashMap<String, JButton>

  3. #3
    ankitmcgill is offline Member
    Join Date
    Nov 2008
    Posts
    22
    Rep Power
    0

Similar Threads

  1. [SOLVED] Linked list question
    By ztrath in forum New To Java
    Replies: 8
    Last Post: 03-12-2009, 12:38 AM
  2. Linked list
    By rosh72851 in forum New To Java
    Replies: 1
    Last Post: 02-05-2009, 08:21 AM
  3. Revised Linked List printing method question
    By CirKuT in forum New To Java
    Replies: 7
    Last Post: 12-12-2008, 11:21 PM
  4. Linked List integer list
    By igniteflow in forum Advanced Java
    Replies: 1
    Last Post: 12-10-2008, 09:53 PM
  5. Linked List Question
    By CirKuT in forum New To Java
    Replies: 4
    Last Post: 12-10-2008, 07:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •