displaying text in jtextarea

J

jkon

Hi i am a begginning programmer, and am having problems displaying text
in a jtextarea.
The goal of the program is that when a button is clicked, then text is
displayed in the jtextarea.
It compiles fine, and runs with no errors. The problem is that the
text is not being displayed in the jtext area. can someone help me?
 
A

Andrew Thompson

Hi i am a begginning programmer, and am having problems displaying text
in a jtextarea.

There is a good group for those beginning Java, it is..
comp.lang.java.help
The goal of the program is that when a button is clicked, then text is
displayed in the jtextarea.
It compiles fine, and runs with no errors.

Are you sure? New programmers are prone to writing code
that hides errors. Where is your (short, self contained) code
so that we can confirm that?

Andrew T.
 
M

Mark Space

Hi i am a begginning programmer, and am having problems displaying text
in a jtextarea.
The goal of the program is that when a button is clicked, then text is
displayed in the jtextarea.
It compiles fine, and runs with no errors. The problem is that the
text is not being displayed in the jtext area. can someone help me?

It was pretty easy when i did it the first time, but I'd had some Java
already, I was using NetBeans to generate the swing componets, and I'm
hardly new to programming in general.

Try adding some "System.err.println( "test..." ); around your code,
especially the parts you think are working. There should be an event
that fires when you click on the button (probably an action event), some
text you grab from somewhere (print that out too) and then .add( "text"
) to the jTextArea.

That's about all there is to it. If you can't figure out what going on,
download NetBeans, add your program as a project, and use the debugger
to step through your code. Sometimes it's the only way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top