Java me javax.microedition.lcdui.TextField.setChars中的IllegalArgumentException
我在.NET中编写了一个简单的web服务,它返回一个字符串值Java me javax.microedition.lcdui.TextField.setChars中的IllegalArgumentException,java-me,midp,lcdui,Java Me,Midp,Lcdui,我在.NET中编写了一个简单的web服务,它返回一个字符串值 [WebMethod] public string DeveloperInfo() { return "Chamara is the appliaction developer"; } 我需要使用J2ME应用程序来使用它 if (displayable == ServiceForm) { if (command == exitCommand1) { //
[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)
哪里出错了?文本框约束似乎失败了。
文本设置为输入数字,您尝试在其中设置字母。
检查它,如果不是这样,然后发布信息的包含。你能确定信息字符串包含什么吗?谢谢…文本框的最大大小是32。webservice返回字符串超过32个字符。还有一件事,你能告诉我什么控件可以用来包含超过32个字符。从你的代码来看,你似乎在使用NetBeans,因此,您可以从UI设置textField的最大大小。不仅仅是32岁。你可以设置它。