Results 1 to 5 of 5
  1. #1
    raghuana is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Question Swing, How to Show The Selected Files and Folder In Tree Structure with CheckBox

    Dear all,

    By using JFileChoor I am able to select file and folders, Getting JList with File Objects and I am showing it with checkbox. Now my requirement is like I want to show the selected file and folder in tree structure, with checkbox and the checkbox should be only for root elements not for all child elements. Please help me as soon as possible, for me its very urgent.

    Example : For Example, I selected folders ABC and PQR which containt sub folders and few files
    now on UI It should be display like :

    Checkbox1 ABC--
    --SubFolders
    . --SubFolder
    . --Files
    --Files
    Checkbox2 PQR--
    --SubFolders
    . --SubFolder
    . --Files
    --Files



    Regards,
    Anand

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    a) See How to Use Trees (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    its very urgent
    b) Urgency is all relative. Mentioning your thread is urgent is disrespectful to others on the forum, who all have their own 'urgencies' and priorities.

  3. #3
    raghuana is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Default

    Hi doWhile,

    Thanks for quick reply. I am able to create the normal tree structure. But problem is I am not able to create it by using checkbox with Root Element only :(
    Could you please help me for the same.

    Like if I selected folders ABC and PQR and file XYZ which containt sub folders and few files
    now on UI It should be display

    Checkbox1 ABC--
    --SubFolders
    . --SubFolder
    . --Files
    --Files
    Checkbox2 PQR--
    --SubFolders
    . --SubFolder
    . --Files
    --Files
    chechbox3 XYZ

    Regards,
    Anand

  4. #4
    raghuana is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Default

    I am Apologized for mentioning the Urgency.I dont want to hurt anybody. I am sorry for this unconscious behavior. I will try to improve myself for the same.

    Regards,
    Anand

  5. #5
    raghuana is offline Member
    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Default

    Dear All,

    I Just Now Created a Image with the Expected Structure.
    I hope it will be help you guys to understand the problem.

    Regards,
    Anand
    Attached Files Attached Files

Similar Threads

  1. Tree Structure
    By chiku in forum New To Java
    Replies: 2
    Last Post: 01-27-2011, 08:31 PM
  2. standart tree structure?
    By willemien in forum New To Java
    Replies: 3
    Last Post: 05-06-2010, 07:56 PM
  3. How to retain the checkbox selected after page load...?
    By prabhurangan in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-24-2008, 08:13 AM
  4. Replies: 0
    Last Post: 07-07-2008, 04:55 PM
  5. Show Text Fields on combo Box selected value
    By smajidali26 in forum AWT / Swing
    Replies: 0
    Last Post: 11-29-2007, 09:28 AM

Tags for this Thread

Posting Permissions

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