Results 1 to 2 of 2
Thread: Help moving the selected files
- 10-10-2011, 08:18 AM #1
Member
- Join Date
- Dec 2009
- Posts
- 29
- Rep Power
- 0
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:
Nothing happens. No file is moved.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)); }Last edited by Radu; 10-10-2011 at 08:21 AM.
- 10-10-2011, 09:31 AM #2
Member
- Join Date
- Dec 2009
- Posts
- 29
- Rep Power
- 0
Similar Threads
-
moving files (text/immages) into jar
By dko in forum Advanced JavaReplies: 5Last Post: 05-26-2011, 03:20 AM -
Swing, How to Show The Selected Files and Folder In Tree Structure with CheckBox
By raghuana in forum AWT / SwingReplies: 4Last Post: 04-13-2011, 03:35 AM -
Moving files in Java
By techbossmb in forum Advanced JavaReplies: 1Last Post: 10-09-2009, 01:55 PM -
Help with moving jpeg files
By Umi in forum New To JavaReplies: 11Last Post: 09-30-2009, 01:11 AM -
Build Javadoc: remembering a selected set of source files
By jhsachs in forum EclipseReplies: 0Last Post: 01-27-2009, 07:14 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks