Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java save file dialog

//Open:

JFileChooser fileChooser = new JFileChooser();
if (fileChooser.showOpenDialog(modalToComponent or null) == JFileChooser.APPROVE_OPTION) {
  File file = fileChooser.getSelectedFile();
  // load from file
}

//Save:

JFileChooser fileChooser = new JFileChooser();
if (fileChooser.showSaveDialog(modalToComponent or null) == JFileChooser.APPROVE_OPTION) {
  File file = fileChooser.getSelectedFile();
  // save to file
}
Comment

PREVIOUS NEXT
Code Example
Java :: spigot repeating task 
Java :: read text file java to string 
Java :: dexter dependency 
Java :: bukkit scheduler delay task 
Java :: java android show toast 
Java :: know the version of maven 
Java :: generate random password in java 
Java :: java age from date 
Java :: Cannot resolve class android.support.design.widget.AppBarLayout 
Java :: zufallszahlen in java 
Java :: objectmapper maven dependency 
Java :: How to solve the towers of Hanoi Java? 
Java :: error: cannot find symbol@javax.annotation.Generated( 
Java :: print list in java 
Java :: printf java boolean 
Java :: import android.support.v4.media.app.NotificationCompat.MediaStyle; 
Java :: spigot scheduler 
Java :: reduce opacity of image in imageview in android 
Java :: take a value from keyboard java 
Java :: InetAddress.getByAddress example 
Java :: how to make an invisiblke button in swing 
Java :: dialog with edittext android 
Java :: java file reader utf 8 
Java :: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade java.lang.OutOfMemoryError (no error message) 
Java :: spring create bean only if another bean does not exists 
Java :: create list of booleans java 
Java :: W/System.err: java.io.IOException: Cleartext HTTP traffic to not permitted 
Java :: spring config.xml file 
Java :: hippo remove property 
Java :: Youtube video thumbnail not load in android 11 or above 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =