当我的程序导出视频时,我有这个加载面板向用户显示。因此,当单击导出按钮时,我会这样做:
loadframe = new LoadFrame("Video Exporteren...");
这将创建对话框并将其显示在屏幕上。然而,对话框上的实际标签显示大约需要 5 秒。谁能告诉我为什么。谢谢
public LoadFrame(String operation) {
mainloadframe = new JDialog();
JLabel operationlabel = new JLabel(operation);
loadpanel = new JPanel();
mainloadframe.setSize(300, 75);
mainloadframe.setLocationRelativeTo(null);
mainloadframe.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
mainloadframe.setAlwaysOnTop(true);
mainloadframe.setTitle(operation);
mainloadframe.setResizable(false);
loadpanel.add(operationlabel);
mainloadframe.add(loadpanel);
mainloadframe.setVisible(true);
}