aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Help with JText Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help with JText" Watch "Help with JText" New topic
Author

Help with JText

Chris Swanson
Greenhorn

Joined: Nov 30, 2009
Posts: 15
Hello. I am trying to create a question/answer form using JTextAreas. However, I have a bug where three JTextAreas appear. Also, I could not find a way to simply replace the text in a JTextField, so I created a new JTextArea and removed the old one. What am I doing wrong in my code?

pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Your code doesn't compile mainly because your class name "Card" doesn't match the constructor name, "LearningCard". This may be a simple oversight by you, but makes our figuring out what's wrong a bit more difficult.

I am also curious why you are adding and removing text components such as JTextAreas rather than just changing the contents of JTextAreas that remain.


Also, where is the code that reproduces your program's "bug"? I suggest that you consider creating and posting a Short, Self Contained, Correct (Compilable), Example or SSCCE that illustrates your problem (please see the link).

Much luck!
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
For instance,


and
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with JText