Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java SwingWorker扩展类未显示溢出的方法_Java_Multithreading_Swing_Swingworker_Event Dispatch Thread - Fatal编程技术网

Java SwingWorker扩展类未显示溢出的方法

Java SwingWorker扩展类未显示溢出的方法,java,multithreading,swing,swingworker,event-dispatch-thread,Java,Multithreading,Swing,Swingworker,Event Dispatch Thread,这是我的示例代码。。。我面临的问题是,我的swingWorker扩展类只将doInBackground()显示为overided方法。我也想使用done()和process()方法,但我的类没有显示@overided,也没有调用done/process方法,因为我知道它是无限循环,但为什么不在publish()上调用process方法呢 公共类getChatSwingWorkerThread扩展SwingWorker{ 私人最终JTextArea聊天区; 私有PostDataConnection

这是我的示例代码。。。我面临的问题是,我的swingWorker扩展类只将doInBackground()显示为overided方法。我也想使用done()和process()方法,但我的类没有显示@overided,也没有调用done/process方法,因为我知道它是无限循环,但为什么不在publish()上调用process方法呢

公共类getChatSwingWorkerThread扩展SwingWorker{
私人最终JTextArea聊天区;
私有PostDataConnection post=null;
private BasicUserInterface聊天窗口=null;
公共getChatSwingWorkerThread(JTextArea text_区域){
chatWindow=新的BasicUserInterface();
this.chat\u text\u area=文本区域;
post=新的PostDataConnection();
}
@凌驾
受保护的字符串doInBackground()引发异常{
字符串returnData=“”;
while(true){
returnData=post.getAvailableChat();
如果(!returnData.equals(“”){
发布(返回数据);
}
} 
}
受保护的无效进程(字符串返回数据){
聊天\文本\区域。追加(返回数据);
}
public void done(字符串returnData)抛出InterruptedException、ExecutionException{
chat_text_area.append(get());
}

这是因为您的
进程
完成
方法的签名与超类中的签名不同

过程
方法的签名为

protected void process(List<V> chunks)

请学习java命名约定并遵守它们。当然,兄弟为什么不呢?我下次一定会关注它。兄弟,这里是兄弟而不是姐妹…哈哈:-)“我下次一定会关注它。”下次我一定会读你的问题。我们姐妹必须团结在一起,嗯?无论如何,我会描述一下EDT v.s.在你回答中提到的背景和方法+1@Robin....Thanks很多…每一天都有新的错误发生,你有新的东西要学。!!!
protected void process(List<V> chunks)
protected void process(List<String> chunks)
protected void done()