Results 1 to 3 of 3
- 08-17-2008, 02:53 AM #1
Member
- Join Date
- Aug 2008
- Posts
- 20
- Rep Power
- 0
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 (TakeOne.zip, 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/TakeOne.zip)
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:
If I am not explained good my 'problem', I can explain more. Thank you!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.Clear(); treeView1.Nodes.Add("Rigg Them All Projects"); this.TreeViewUpdate.ShowNodes(root, treeView1.Nodes[0]); treeView1.Nodes[0].Expand();
Kind regards, Grom
- 08-17-2008, 01:52 PM #2
look at the File class. It has a method mkdir that will create a folderHow can I create a folder
- 08-20-2008, 09:01 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
You have to something like this, in much better way.
Java Code:File temp = new File("temp_folder"); // Folder path if(!temp.exists()) { temp.mkdirs(); }
Similar Threads
-
code to create a folder in java
By radhika123 in forum New To JavaReplies: 7Last Post: 07-21-2011, 11:21 AM -
Beginner; Create a class to store info and constructor to initialize
By badness in forum New To JavaReplies: 16Last Post: 05-08-2008, 09:45 PM -
Create a VeryLong class that will store an integer of arbitrary length.
By hey in forum New To JavaReplies: 2Last Post: 12-12-2007, 05:01 PM -
how to use btree to store data
By fred in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks