Results 1 to 3 of 3
  1. #1
    Grom is offline Member
    Join Date
    Aug 2008
    Rep Power

    Default How to create folder(s) and store data?

    Hello all,

    Fresh to ubuntu and NetBeans.

    I am trying to translate my C# app to Java. You can download NetBeans project (, 226 Kb) for better flow. (well this is my 2nd post and I can not post links yet, so I'll try to write the link: www dot beezgetz dot com/NetBeans/

    How can I create a folder(s) and store data in them, for app to use?
    How can I populate tree which should mimic those folders?

    Here is the code I used in C# app to create folders and populate tree:
    Java Code:
    Directory.CreateDirectory("c:/Rigg Them All Projects/" + Form5.novProjekt);
    Directory.CreateDirectory("c:/Rigg Them All Projects/" + newProjectName + "/" + "Grid");
    Directory.CreateDirectory("c:/Rigg Them All Projects/" + newProjectNamet + "/" + "Truss");
     Directory.CreateDirectory("c:/Rigg Them All Projects/" + newProjectName + "/" + "Bridle");
      //___treeview updates from those folders above
    DirectoryInfo root = new DirectoryInfo("c:/Rigg Them All Projects"); // Our root path, we start here
    treeView1.Nodes.Add("Rigg Them All Projects");
    this.TreeViewUpdate.ShowNodes(root, treeView1.Nodes[0]);
    If I am not explained good my 'problem', I can explain more. Thank you!

    Kind regards, Grom

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    On vacation
    Rep Power


    How can I create a folder
    look at the File class. It has a method mkdir that will create a folder

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power


    You have to something like this, in much better way.

    Java Code:
                File temp = new File("temp_folder"); // Folder path
                if(!temp.exists()) {

Similar Threads

  1. code to create a folder in java
    By radhika123 in forum New To Java
    Replies: 7
    Last Post: 07-21-2011, 11:21 AM
  2. Replies: 16
    Last Post: 05-08-2008, 09:45 PM
  3. Replies: 2
    Last Post: 12-12-2007, 06:01 PM
  4. how to use btree to store data
    By fred in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:52 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