Java Swing:模态加载屏幕? [英] Java Swing: Modal loading screen?
本文介绍了Java Swing:模态加载屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个加载网页的 Java swing 应用程序.有时,网页需要一段时间才能加载,具体取决于用户的互联网连接.
I have a Java swing application which loads a web page. Sometimes, the web page takes a while to load depending on the user's internet connection.
我想阻止这个框架直到页面加载完毕.
I want to block this frame until page has loaded.
推荐答案
最简单的选择就是弹出一个模态对话框:
The simplest option is to pop up a modal dialog:
JDialog modalDialog = new JDialog(frame, "Busy", ModalityType.DOCUMENT_MODAL);
modalDialog.setSize(200, 150);
modalDialog.setLocationRelativeTo(frame);
modalDialog.setVisible(true);
您可能想在其中放置一个进度条.
You may want to put a progress bar in it.
这篇关于Java Swing:模态加载屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文