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
Post a Comment