java.lang.NumberFormatException: For input string: ""
843810Feb 18 2006 — edited Sep 18 2007Hi.
I am new to this forum.I have not so much idea in java swing.I am doing an application in java swing.I used a JTextField.In side a loop I have written as below
if(!(txt_pageNo.getText() == ""))
{
System.out.println("coming in textfield..... 998");
if((Integer.parseInt(txt_pageNo.getText()) > commTotPage) || Integer.parseInt(txt_pageNo.getText()) <= 0)
{
}else
if((Integer.parseInt(txt_pageNo.getText()) != currentCommPage))
{
commTableDisplayOptionNo = 0;
currentCommPage = Integer.parseInt(txt_pageNo.getText());
comTabDispName = "MyVaayooPoker Communities" ;
Thread tt = new Thread()
{
public void run()
{
try
{
displayContrrol = 1;
String request = "reqid=01,appid=smruti,alphabet=all,commBulkNo="+currentCommPage;
httpTest.sendRequest(request);
//System.out.println("controller will come here");
}
catch(Exception e)
{
System.out.println("in sending requsst2..");
}
}
};
tt.start();
}
I have set initial text = " ";
When I left the field blank it still enters in side the if(!(txt_pageNo.getText() == "")) and giving me java.lang.NumberFormatException: For input string: "" error.
Thanks.
Srikant