我收到一条错误消息:
no suitable method found for showMessageDialog(<anonymous Runnable>,String,String,int)
当我尝试使用该JOptionPane.show...
方法时。这是为什么 ?
private void connectivityChecker() {
Runnable r = new Runnable() {
@Override
public void run() {
try {
Thread.sleep(3000);
}catch(Exception exc) {
System.out.println("Thread Interrupted !");
}
boolean isConnected = Internet.isConnected();
if(!isConnected) {
JOptionPane.showMessageDialog(this, "You have lost connectivity to the server", "Connection Error", JOptionPane.ERROR_MESSAGE);
}
}
};
new Thread(r,"Connectivity Checker - UserGUI").start();
}