Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The textarea is not getting value

 
budsy remo
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


My problem is that the textarea in the local inner class is not getting the value that i type when i run the code and click the get from the menu . It is supposed to take the value from the textarea and then print it on command line .
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Always, always, to get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem. That means eliminating all unrelated stuff such as setting fonts and borders, and removing unnecessary vertical white space. Remember, the shorter it is, the more members will read it.

2. Learn to use layouts correctly. That means no calls to setBounds(...). I'm sure you've been told this before.

3. Use meaningful variable names. Names like jta1, jep1, jfc1 aren't.

4. I don't see anywhere in the posted code that jta1 is added to the visible component hierarchy, so why does it surprise you that its text remains empty?
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the bare minimum (doesn't work, but allows to see the problem) :
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the problem is that once again, the JTextArea jta1 isn't added to a visible component hierarchy. Isn't that obvious to you?
 
budsy remo
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Darryl Don't you think that i added the textarea through a JScrollPane ?
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. In the first code posted, that JScrollPane isn't added to any container.

2. In the second code posted, there's no JScrollPane.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic