本文整理汇总了Java中javax.swing.JProgressBar.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java JProgressBar.setVisible方法的具体用法?Java JProgressBar.setVisible怎么用?Java JProgressBar.setVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JProgressBar
的用法示例。
在下文中一共展示了JProgressBar.setVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showUpgradeDialog
import javax.swing.JProgressBar; //导入方法依赖的package包/类
private static boolean showUpgradeDialog (final File source, String note) {
Util.setDefaultLookAndFeel();
JPanel panel = new JPanel(new BorderLayout());
panel.add(new AutoUpgradePanel (source.getAbsolutePath (), note), BorderLayout.CENTER);
JProgressBar progressBar = new JProgressBar(0, 100);
progressBar.setValue(0);
progressBar.setStringPainted(true);
progressBar.setIndeterminate(true);
panel.add(progressBar, BorderLayout.SOUTH);
progressBar.setVisible(false);
JButton bYES = new JButton("Yes");
bYES.setMnemonic(KeyEvent.VK_Y);
JButton bNO = new JButton("No");
bNO.setMnemonic(KeyEvent.VK_N);
JButton[] options = new JButton[] {bYES, bNO};
JOptionPane p = new JOptionPane (panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION, null, options, bYES);
JDialog d = Util.createJOptionProgressDialog(p, NbBundle.getMessage (AutoUpgrade.class, "MSG_Confirmation_Title"), source, progressBar);
d.setVisible (true);
return new Integer (JOptionPane.YES_OPTION).equals (p.getValue ());
}
示例2: showUI
import javax.swing.JProgressBar; //导入方法依赖的package包/类
private static void showUI(){
sFrame = new JFrame();
JProgressBar progressBar = new JProgressBar();
progressBar.setVisible(false);
progressBar.setIndeterminate(false);
progressBar.setIndeterminate(true);
progressBar.setIndeterminate(false);
progressBar.setValue(10);
progressBar.setString("Progress");
sFrame.add(progressBar);
sProgressBar = new WeakReference<>(progressBar);
sFrame.setSize(200,200);
sFrame.setVisible(true);
}