Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

print data to textarea

 
Tapan Prajapati
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

m use net bean and i want to print the data to text area but i only print them it in command prompt not in text area
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like a Swing question since it is about outputting data to a JTextArea. Moving to our Swing forum.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have in your code this:
System.out.println(name +"\t" + "-"+ phonenumber);

and this:
pw.println( name + "\t" + phonenumber);

and this:
recordTextArea.setText(phonenumber);

it seems you know how to access the textArea (unless this is not your code),
so just refer to the JTextArea apidocs for a method to add, or append (hint), text.
 
Tapan Prajapati
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya but i had already define them in private field

now tell me what can i do
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> now tell me what can i do

I already told you 'where' and 'what'.

if you want someone to write it for you, try rent-a-coder
 
Tapan Prajapati
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't know what you want to say , you reply if you know answer. i just want to print the database data to my text area that's all.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> you reply if you know answer.

I do, because I've read the documentation.

I even gave you a hint in my first reply.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tapan,
Please use the quote button only when you want to quote something. For your own replies, please use the Post Reply button
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tapan Prajapati wrote:i just want to print the database data to my text area that's all.

Have you even read Michael's first reply?
Michael Dunn wrote:so just refer to the JTextArea apidocs for a method to add, or append (hint), text.

Click on JTextArea if you don't know how to find the API docs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic