How do i add a new line in Swing? Im using netbeans, here is my source code:
This is what it outputs:
I want the output to be organized, like this:
1 Computer - 706
100 Computers = 70600
200 Computers - 141200
etc , How do i change this?
To clarify, it is showing the output straight across the screen.1 Computer 706 100 Computer 70600 200 Computer 141200 300 Computer 211800 400 Computer 282400 500 Computer 353000 600 Computer 423600 700 Computer 494200 800 Computer 564800 900 Computer 635400 1000 Computer 706000
private void CostWOutShippingActionPerformed(java.awt.event.ActionEvent evt) { Output.setText(Output.getText() + "1 Computer" + "\t" + 706 + "\n" ); Output.setText(Output.getText() + "100 Computers" + "\t" + 70600 + "\n" ); Output.setText(Output.getText() + "200 Computers" + "\t" + 141200 + "\n" ); Output.setText(Output.getText() + "300 Computer" + "\t" + 211800 + "\n" ); Output.setText(Output.getText() + "400 Computer" + "\t" + 282400 + "\n" ); Output.setText(Output.getText() + "500 Computer" + "\t" + 353000 + "\n" ); Output.setText(Output.getText() + "600 Computer" + "\t" + 423600 + "\n" ); Output.setText(Output.getText() + "700 Computer" + "\t" + 494200 + "\n" ); Output.setText(Output.getText() + "800 Computer" + "\t" + 564800 + "\n" ); Output.setText(Output.getText() + "900 Computer" + "\t" + 635400 + "\n" ); Output.setText(Output.getText() + "1000 Computer" + "\t" + 706000 + "\n" ); }