|
-
Swing GUI and Multithreading
Dear All,
I have gui, data starts flowing as soon as Connect button is press. Coz of
mulitthreading gui get freeze.
private class ConnectionThread
implements Runnable
{
public void run()
{
try
{
System.out.println("In ConnectionThread Run Method");
OiJsshEngine sshEngine = new OiJsshEngineImpl(getOptions());
OiJsshConnection sshConnection = sshEngine.getSSHConnection();
OiJsshStreamFilter filter = null;
filter = new OiJsshStreamFilterImpl("#");
filter.setUI(txtData);
filter.setPatternMatcherStream(System.err);
filter.setPatternMismatchStream(System.out);
OiJsshStreamWriterThread writerThread = new
OiJsshStreamWriterThread(sshConnection.getOutputStream());
writerThread.start();
sshConnection.execShell();
}
catch(Exception e)
{
System.out.println(e);
}
}
private void cmdConnectActionPerformed(ActionEvent evt)
{
cnn = new ConnectionThread();
Thread t = new Thread(cnn);
t.setDaemon(true);
SwingUtilities.invokeLater(t);
}
What alternative can i work on.
Thank in advance for the pointers.
Regards,
Ketan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks