Take the tour ×  How can I print the texts from a TextArea using
a jButton? I'm using netbeans, btw. Can anyone help me? It's for
my midterm project in school.  share|improve this question add
comment  1 Answer  use getText() method of textarea to get the
text. Use System.out.println() to print it in console, or if not
console, follow your approach. Do these things inside the
JButton's event handler.  public void
actionPerformed(ActionEvent aew)     JTextArea text = new
JTextArea();      String result = text.getText(); share|improve
this answer I mean, literally print from a printer. The code for
printing something from the program itself. :( –  Lerianne Mae
Uguil Jul 30 '12 at 9:48 OK, please make your questions clear in
future. Have a look in here 1.
docs.oracle.com/javase/tutorial/2d/printing/index.html 2.
stackoverflow.com/questions/3959064/… –  FlowOverStack Jul 30
'12 at 14:25 add comment  Your Answer