[英]java exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException
[英]Getting error - Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: text cannot be null or empty
嘗試使用文本區域將字符串發送到IBM Watson。
可以通過對String進行硬編碼來做到這一點。 我希望能夠在JTextArea中輸入自己的文本。
移動String text = textArea.getText();
在actionPerformed
方法內部,如下所示:
public void actionPerformed(ActionEvent e) {
String text = textArea.getText();
Profile profile = service.getProfile(text).execute();
System.out.println(profile);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.