how to save output (from TextField) to a particular Folder as txt file

hi,
i m facing a small prob in GUI, need to save my output to a particular folder.

below this code showing the square of any integer in TextField named: "resultField". i've a button "save" that need to save the result from that TextField, suppose in my "c:\Repository " folder as a txt file.

In addition, the name of the txt file can be same as given input integer. Example: 77, 99, .. whatever the input integer.

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {