Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Reading information from TextAreas

Thread view: 
MacEgan - 17 Dec 2005 16:42 GMT
Hi I am new to Java (one week) and as such it is driving me mad.
I am trying to read the information out of a TextArea but I am getting
an AWI-eventQueue-0 exception. The code is as follows where test is a
TextArea. The reason it is cracking me up is that it works fine if I
use a TextField in its place.
    String message;
    message = this.test.getText().toString();

Anybody out their want to pull me back from the edge.
Anthony.
zero - 17 Dec 2005 17:12 GMT
> Hi I am new to Java (one week) and as such it is driving me mad.
> I am trying to read the information out of a TextArea but I am getting

why TextArea and not JTextArea?

> an AWI-eventQueue-0 exception. The code is as follows where test is a

AWI-eventQueue-0 is not an exception.  I'm not sure what it is actually.  
What is the exact error message?

> TextArea. The reason it is cracking me up is that it works fine if I
> use a TextField in its place.
>      String message;
>      message = this.test.getText().toString();

Please show us the declaration or, even better, a short compilable example
(meaning we can copy the code and compile it without adding or changing
anything).  Make it as short as possible without removing the error.  It is
quite possible that merely making such a short example will help you find
the error.

Those two lines are correct, although:

1. you don't need "this", unless you need to resolve a naming conflict
2. TextArea:getText() returns a String, there's no need to call toString()
on it.

Signature

Beware the False Authority Syndrome

Andrew Thompson - 17 Dec 2005 23:34 GMT
> Please show us the declaration or, even better, a short compilable example
> (meaning we can copy the code and compile it without adding or changing
> anything).  Make it as short as possible without removing the error.  It is
> quite possible that merely making such a short example will help you find
> the error.

<http://www.physci.org/codes/sscce.jsp>

Signature

Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.