Results 1 to 2 of 2
  1. #1
    Radu is offline Member
    Join Date
    Dec 2009
    Posts
    29
    Rep Power
    0

    Question Help moving the selected files

    Hello!
    I m trying to move into another folder some files that I select from a jList.
    Here is the code:
    Java Code:
       private void butonUploadSActionPerformed(java.awt.event.ActionEvent evt) {                                             
            String deTrs = "D:\\Radu\\Lucru\\Programare\\Test\\Trs\\";
    	String Clar = "D:\\Radu\\Lucru\\Programare\\Test\\Cl\\";
    	String Cry = "D:\\Radu\\Lucru\\Programare\\Test\\Cr\\";
    	String Iesiri = "D:\\Radu\\Lucru\\Programare\\Test\\Iesiri\\";
    
    // When I press the UploadS from menu
    // every file that I select from listaTransmisie jList is moved into Clar = "D:\\Radu\\Lucru\\Programare\\Test\\Cl\\" folder
    
            for (Object item : listaTransmisie.getSelectedValues())
    		{
    			String sourceFile = deTrs + listaGrupuri.getSelectedValue().toString() + "\\" + item.toString();
    
    			String destFile = null;
    			File fileInfo = null;
    			fileInfo = new File(sourceFile);
    			destFile = Clar + fileInfo.getName();
    			fileInfo.renameTo(new File(destFile));
    		}
    Nothing happens. No file is moved.
    Last edited by Radu; 10-10-2011 at 09:21 AM.

  2. #2
    Radu is offline Member
    Join Date
    Dec 2009
    Posts
    29
    Rep Power
    0

    Default Re: Help moving the selected files

    Found the error. My mistake I moved some folders and I forgot to change some lines in my program regarding those folders.
    Now is solved.

Similar Threads

  1. moving files (text/immages) into jar
    By dko in forum Advanced Java
    Replies: 5
    Last Post: 05-26-2011, 04:20 AM
  2. Replies: 4
    Last Post: 04-13-2011, 04:35 AM
  3. Moving files in Java
    By techbossmb in forum Advanced Java
    Replies: 1
    Last Post: 10-09-2009, 02:55 PM
  4. Help with moving jpeg files
    By Umi in forum New To Java
    Replies: 11
    Last Post: 09-30-2009, 02:11 AM
  5. Replies: 0
    Last Post: 01-27-2009, 08:14 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
  •