Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java GUI 设计 » Swing  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:请教大侠们一个问题--进度条 [Re:jlynnc]
floater

Java Jedi

总版主


发贴: 3233
积分: 421
于 2002-12-08 14:20 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
The reason is that you are using the same thread for swing event dispatching *and* ftp. So you have to fire off ftp from a different thread.
There are several ways:
1. SwingUtilities in swing
2. Sun also has a Thread worker class(do a search at sun.com)
3. A simple embedded as follows(My own woking code, but use it freely)

if ((e.getClickCount() == 2) && SwingUtilities.isLeftMouseButtonEnvelope)
{
debugLine("Left mouse double selected. Go get data!");
//////////////////////////////////////////////////
//This will start a new thread so it won't block the
//Event Dispatch Thread.

Thread worker = new Thread()
{
public void run()
{
//This sets the progress bar
StockChart.getFrame().setProgressBar(true);
//do whatever you want

//This reset the progress bar
StockChart.getFrame().setProgressBar(false);
}
};
worker.start();
}




话题树型展开
人气 标题 作者 字数 发贴时间
51412 请教大侠们一个问题--进度条 jlynnc 111 2002-12-07 13:22
43452 解决办法 levels 30 2002-12-08 00:52
43518 try this out snowbug 502 2002-12-08 11:50
43186 Re:try this out Biubiu 587 2002-12-09 11:15
47294 Re:请教大侠们一个问题--进度条 floater 981 2002-12-08 14:20
42954 Re:请教大侠们一个问题--进度条 snowbug 2552 2002-12-09 02:00
45174 Re:请教大侠们一个问题--进度条 floater 183 2002-12-09 06:05
43144 Re:请教大侠们一个问题--进度条 snowbug 398 2002-12-09 14:00
46498 Re:请教大侠们一个问题--进度条 floater 1049 2002-12-09 22:28
43312 About foxtrot snowbug 1255 2002-12-09 22:57
45176 Re:请教大侠们一个问题--进度条 floater 424 2002-12-10 01:09

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923