Results 1 to 9 of 9
  1. #1
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default [help].Maintaining previous entries in swing application.

    hello Everyone,
    I am making a swing application to hide files and folders.
    I have used Runtime exec method to hide files and folders using command prompt successfully.

    Now ,suppose a user hides a folder and closes the application,and then again opens my application , he should be presented with list showing hidden folders.

    Can anyone please help me doing that.
    Thanks

  2. #2
    Ronin is offline Senior Member
    Join Date
    Oct 2010
    Posts
    317
    Rep Power
    4

    Default Re: [help].Maintaining previous entries in swing application.

    How are you currently hiding the folders?

    Regards.

  3. #3
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: [help].Maintaining previous entries in swing application.

    Here is my code to hide folders, and it is working correctly.

    Java Code:
    rt=Runtime.getRuntime();
    JFileChooser jfc=new JFileChooser();
    jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    if(result==JFileChooser.APPROVE_OPTION)
    	{
    	String str=jfc.getSelectedFile().getPath();
    	String str1="\""+str+"\"";
             }
    
                            String tohide="attrib +s +h "; 
    			String cmd="cmd.exe /c start cmd /c";
    			String fina=cmd+tohide+str1;
    			try {
    				
    				rt.exec(fina);
    			
    			} catch (IOException e1) { }
    Last edited by heman; 04-13-2013 at 06:43 PM.

  4. #4
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: [help].Maintaining previous entries in swing application.

    Can someone come up with a solution

  5. #5
    Ronin is offline Senior Member
    Join Date
    Oct 2010
    Posts
    317
    Rep Power
    4

    Default Re: [help].Maintaining previous entries in swing application.

    Your actual issue is not related to Java which would account for the lack of responses. Instead you want to be looking for the command syntax to use and a quick google came up with the following page.
    Change File Attributes, Create supper hidden folders in Windows using attrib.exe

    Make a list of all hidden system files and folders

    In the rare eventuality that you forget the name of the folder, but know the location – or vice versa, you can run the following command.

    “attrib C:\*.* /s|find “A SH”>C:\hiddensystemfiles.txt&notepad C:\hiddensystemfiles.txt

    This will output the list of all hidden system folders on your C drive.
    You can of course modify the syntax suitable to search for only select locations also.
    You should be able to construct a string based on the above information.

    If however you want to show just the files modified by your application you will need to add a file or record which lists all of the effected files.

    Regards.

  6. #6
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: [help].Maintaining previous entries in swing application.

    Thanks for your reply.
    My question is definately related to java as I am not asking how to hide folders using java.I had already done it myself.
    I wish to know that is there anyway that the user may be presented by the list of folder he had hidden using my application.

  7. #7
    Ronin is offline Senior Member
    Join Date
    Oct 2010
    Posts
    317
    Rep Power
    4

    Default Re: [help].Maintaining previous entries in swing application.

    You can check for folder visibility but not how a folder became hidden. The only way I can see of doing that would be as I previously stated, to retain a list of folders previously modified through the application and store these in another file.

    Regards.

  8. #8
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: [help].Maintaining previous entries in swing application.

    ok fine,i will be able to save record with folder path to a text file.
    Then how to import that file and present directly to user when user closes and reopen my application again.

    I wish to make similar application like hide folders , folder lock ,folder security personal etc.
    By the way i am not advertising any of these apps but rather giving explanation what i wish to do.

    Thanks

  9. #9
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: [help].Maintaining previous entries in swing application.

    ok fine,i will be able to save record with folder path to a text file.
    Then how to import that file and present directly to user when user closes and reopen my application again.

    I wish to make similar application like hide folders , folder lock ,folder security personal etc.
    By the way i am not advertising any of these apps but rather giving explanation what i wish to do.

    Thanks

Similar Threads

  1. rs.previous() &swing
    By mohsen.noor in forum JDBC
    Replies: 3
    Last Post: 03-25-2013, 11:21 AM
  2. Replies: 0
    Last Post: 01-14-2013, 07:53 PM
  3. Replies: 0
    Last Post: 10-28-2010, 07:18 PM
  4. Existing swing application
    By macason in forum AWT / Swing
    Replies: 3
    Last Post: 11-30-2009, 10:51 PM
  5. Maintaining logs of a chat session
    By vrk in forum AWT / Swing
    Replies: 1
    Last Post: 10-27-2009, 03:18 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
  •