Swing中的进度对话框 [英] Progress Dialog in Swing

查看:46
本文介绍了Swing中的进度对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不执行 Runnable 实例并让该实例更新该对话框上的进度条/消息的持续时间内使模态 JDialog 不出现按钮?

How can I make a modal JDialog without buttons appear for the duration it takes a Runnable instance to complete and have that instance update a progress bar/message on that dialog?

很明显,意大利面条式的代码可能有效,但我正在寻找一种简洁的设计.

Clearly spaghetti code might work, but I'm looking for a clean design if one exists.

推荐答案

您可能想研究如何使用进度监视器.

You might want to look into ProgressMonitor. It automatically pops up a dialog with a progress bar if the operation is taking a long time; see How to Use Progress Monitors.

这篇关于Swing中的进度对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆