aspose file tools*
The moose likes Beginning Java and the fly likes GetText problem in a GUI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "GetText problem in a GUI" Watch "GetText problem in a GUI" New topic
Author

GetText problem in a GUI

garfild Baram
Ranch Hand

Joined: Mar 24, 2003
Posts: 60
Hi,
I have a very very strange problem.
I created a GUI that contains a text box text1.
In my code I have the following line:
String LabelId = text1.getText().trim();
If (LabelId == null)
{
......
}
I didn't initialized text1 so i expected to enter the If statement but it didn't.
even
If (LabelId == "")
{
......
}
dosent put me inside the If!
What did I miss???
Please advise
garfild
Amol Desai
Ranch Hand

Joined: Jan 29, 2003
Posts: 82
Hi,
Try using
if (LabelId.equals(""))
{
......
}
Get back in case of any problems
garfild Baram
Ranch Hand

Joined: Mar 24, 2003
Posts: 60
It works as needed.
Thanks Amol
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GetText problem in a GUI
 
Similar Threads
Problem with FOR loop..Need Help ASAP...
problem with inhereitance
How can I control a CPU usages?
using variables or input GUI components in SQL insert statement as arguments
Wrapper