进度条与函数同时运行(在另一个类中) [英] Progress bar to run simultaneously with a function(in another class)

查看:133
本文介绍了进度条与函数同时运行(在另一个类中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个表单,其中有两个组件,按钮和进度条(Netbeans拖放).Form包含我的应用程序启动的主要方法。我已经创建了另一个类,其中我编写了一个函数。我想要的是,当我按下按钮时,应用程序进入该功能,进度条与其同时运行,当该功能完成其功能时,进度条显示100%完成。现在此功能可以随时使用完成所以我无法设置进度条的最大值。所以,在这种情况下该怎么办?任何人都可以给我一个很好的例子。

I have created a form on which two components are present, button and progressbar (Netbeans drag and drop).Form contains the main method from where my application starts.I have created another class as well in which i have written a function.What i want is that when i press a button the application goes into the function and the progressbar runs simultaneously with it and when that function is complete with its functionality the the progress bar shows 100% complete.Now this function can take anytime for its completion so i cannot set the max value for the progressbar.So, what to do in this case?Can anyone please provide me with a good example .

推荐答案

JProgressBar.setIndeterminate(true)

这篇关于进度条与函数同时运行(在另一个类中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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