0

I'm creating a program where I get input from the user and then I want said input to be put into a text file. Currently I already have the popup window, text box and button, but how can I make it so that upon pressing the button, the text in the textbox is saved to a new text file?

private JLabel intro;
private JButton submit;
private JTextField a1, a2, a3, a4, a5, a6, a7;

public Work() {
    setLayout(new FlowLayout());

    intro=new JLabel ("<html>Please give each subject a weight of importance and a relative score<br>the product functional business goal<br>product's release strategic intent<br>product's new functionality<br>product's improved functionality<br>product's quality (performance, reliability…)<br>product's development enabler<br>timeing related competative factors (there is potential impact of delaying - time to market, is it a market differentiator)</html>");
    add(intro);


    a1=new JTextField (30);
    add(a1);


    submit=new JButton ("Submit");
    add(submit);
}

public static void main (String args[]){
    Work gui=new Work();
    gui.setDefaultCloseOperation(JFrame .EXIT_ON_CLOSE);
    gui.setVisible(true);
    gui.setSize(1000, 800);
    gui.setTitle("Test");
}

}
Hydrataur
  • 1
  • 3
  • 5
    [Search first - How do I save a string to a text file using java?](http://stackoverflow.com/questions/1053467/how-do-i-save-a-string-to-a-text-file-using-java) – Milkmaid May 24 '16 at 06:09
  • You should show us your code, and what you've attempted so we can help you further, thanks. Edit your post with the additional information. – XaolingBao May 24 '16 at 06:37

0 Answers0