swing - Moving files in java -


so far code move selected file path define later in code how path selcted file

import java.awt.component; import javax.swing.jfilechooser;    public class copyfileexample  {     public static void main(string[] args)     {             final jfilechooser fc = new jfilechooser();         component acomponent = null;         int returnval = fc.showopendialog(acomponent);     } } 

you can selected file way:

if (returnval == jfilechooser.approve_option) {   file file = fc.getselectedfile();   ... } else {   // means user closed dialog or pressed cancel } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -