Re: JtextField returning empty!
tamasu wrote:
Hi,
I am trying to read text from a simple Jtextfield using the syntax
String StrRound = txtRoundName.getText();
if (StrRound.equals("")) ... etc
Nothing wrong with that.
I am also using the method dispose() to close the window. Since when
the window is re launched the previous contents inserted in the
txtRoundName is displayed, I had to clear the fields using
txtRoundName.setText(""); in a separate method.
I don't think dispose() will do anything to the value entered into your
JTextField.
I found out that when enabling the setText(""), the condition if
(StrRound.equals("")) is returning that the string StrRound is empty
(actually the user keys in some data). Whilst, when I remove the
statement txtRoundName.setText("") everything works fine.
It's not really clear what you are doing.
The window is instantiated through a separate class.
Could you highlight why this is occurring?
Not without some code and preferably an SSCCE.
--
Knute Johnson
email s/nospam/knute2009/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access