• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

The textarea is not getting value

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the bare minimum (doesn't work, but allows to see the problem) :
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ Darryl Don't you think that i added the textarea through a JScrollPane ?
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic