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");
}
}