dispose() is not the same as setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
问题 I noticed that if setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) is set, closing the frame will end its Process in Task Manager, but if i implement WindowListener and manually dispose() the frame, Process will remain... probably because in new Runnable() i have something like this: new Runnable() { void run() { Jsch tunnel=new Jsch(); JFrame frame=new JFrame(); frame.addWindowListener(new WindowListener() { frame.dispose(); } ); // imagine that this is legal frame.setVisible(true); } } Anyone