javax.microedition.lcdui.TextField.setChars 处的 IllegalArgumentException
我在 .NET 中编写了一个简单的 Web 服务,它返回一个字符串值。
[WebMethod]
public string DeveloperInfo()
{
return "Chamara is the appliaction developer";
}
我需要使用 J2ME 应用程序使用它。以下是我使用的代码
if (displayable == ServiceForm) {
if (command == exitCommand1) {
// write pre-action user code here
switchDisplayable(null, getTaskList());
// write post-action user code here
} else if (command == okCommand2) {
try
{
new Thread(new Runnable()
{
public void run()
{
try {
service1.Service1_Stub service=new service1.Service1_Stub();
String Info= service.DeveloperInfo().toString();
txtService.setString(Info);
// write post-action user code here
} catch (Exception ex) {
ex.printStackTrace();
}
}
}).start();
}catch (Exception e){System.out.println(e.toString());}
它给出了以下异常
java.lang.IllegalArgumentException
at javax.microedition.lcdui.TextField.setChars(TextField.java:747)
at javax.microedition.lcdui.TextField.setString(TextField.java:666)
at com.sliit.j2me.tutorial.TaskList$1.run(TaskList.java:155)
我哪里出错了?
I have wrote a simple web service in .NET which return a string value.
[WebMethod]
public string DeveloperInfo()
{
return "Chamara is the appliaction developer";
}
I need to consume it using a J2ME application.following is the code i have used
if (displayable == ServiceForm) {
if (command == exitCommand1) {
// write pre-action user code here
switchDisplayable(null, getTaskList());
// write post-action user code here
} else if (command == okCommand2) {
try
{
new Thread(new Runnable()
{
public void run()
{
try {
service1.Service1_Stub service=new service1.Service1_Stub();
String Info= service.DeveloperInfo().toString();
txtService.setString(Info);
// write post-action user code here
} catch (Exception ex) {
ex.printStackTrace();
}
}
}).start();
}catch (Exception e){System.out.println(e.toString());}
It gives the following Exception
java.lang.IllegalArgumentException
at javax.microedition.lcdui.TextField.setChars(TextField.java:747)
at javax.microedition.lcdui.TextField.setString(TextField.java:666)
at com.sliit.j2me.tutorial.TaskList$1.run(TaskList.java:155)
Where I have got wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来 TextBox 约束失败了。
前任。文本设置为接受输入数字,并且您尝试在其中设置字母。
检查它,如果不是这种情况,则发布 Info.plist 的内容。
It seems TextBox constraint fails.
Ex. The Text is set to take input numbers and you try to set alphabets into it.
check it and if it isn't the case then post the contain of Info.