Results 1 to 3 of 3
  1. #1
    Subhalaxmi is offline Member
    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Default Unable to select/deselect items in a JList while it is performing some task

    Hi,
    I am using JList to show some data in JScrollPane.If I am selecting some items from the JList to perform some task I am unable to deselect them or select any other items from the JList until the completion of the task .

    I want to deselect selected items or select the other items to perform some other task before completion of the 1st task.

    I am using swing,awt in my code to develop the GUI.I tried by creating child thread todeslect the items,but unable to deselect.

    Can any one help me how can I use the JList items to perform some other task before comletion of the 1st task.

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

    Default

    Quote Originally Posted by Subhalaxmi View Post
    Hi,
    I am using JList to show some data in JScrollPane.If I am selecting some items from the JList to perform some task I am unable to deselect them or select any other items from the JList until the completion of the task .

    I want to deselect selected items or select the other items to perform some other task before completion of the 1st task.

    I am using swing,awt in my code to develop the GUI.I tried by creating child thread todeslect the items,but unable to deselect.

    Can any one help me how can I use the JList items to perform some other task before comletion of the 1st task.
    You are probably creating a child thread for the wrong task. You may be better served creating a child thread to gather the data that is displayed in the JScrollPane, the thread that is currently freezing your GUI. A SwingWorker may work well here.

  3. #3
    Dinesh_rockz is offline Member
    Join Date
    Jan 2011
    Location
    India
    Posts
    22
    Rep Power
    0

    Default

    JList.clearSelection();

    clearSelection() Method is used to Deselect the all selected values;

Similar Threads

  1. Adding \ removing items from Jlist
    By Desperado in forum AWT / Swing
    Replies: 10
    Last Post: 12-17-2009, 12:48 PM
  2. Clicking Items inside of a JList
    By hunterbdb in forum AWT / Swing
    Replies: 9
    Last Post: 10-21-2009, 06:50 PM
  3. How can I save items in my JList?
    By yoodidoo in forum New To Java
    Replies: 2
    Last Post: 08-02-2009, 06:36 AM
  4. jlist items
    By bullstreetboy in forum New To Java
    Replies: 6
    Last Post: 04-12-2009, 05:30 PM
  5. CheckBox Jlist items
    By dropez in forum AWT / Swing
    Replies: 1
    Last Post: 03-26-2009, 07:39 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
  •