Search the Community
Showing results for tags 'gui settings'.
Found 1 result
Save and Load GUI Settings Tutorial by Worthy In this tutorial We will be using java.util Propteries class to save and load settings from your GUI (or anything else that is applicable) ________ Adding the proper variables for preparation. In your Main class add the location to save the GUI settings In your GUI class we must create the Save and Load settings methods Implementing the methods On the "Start" button, we will call saveSettings(); On the script initiation we will call the loadSettings(); (after the GUI has been loaded) -->Alternatively you can just create seperate save and load buttons on the GUI. Tying everything together: The first thing the script will do is declare the File Path, and initiate the Preferences file. When the GUI loads, the script will then call loadSettings(), loading the settings (if any). If no settings are saved, it well then create a new file in the path. Right before the GUI is disposed it will save all the settings the user has applied in TRiBot's storage directory. (You can print out the location if you don't know where that is for your OS). _________ Complete Example script: GUISettings.java (Main class) GUIExample.java (GUI class) Regards, Worthy