本文整理汇总了Java中charvax.swing.JProgressBar.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java JProgressBar.setValue方法的具体用法?Java JProgressBar.setValue怎么用?Java JProgressBar.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类charvax.swing.JProgressBar
的用法示例。
在下文中一共展示了JProgressBar.setValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LogWindow
import charvax.swing.JProgressBar; //导入方法依赖的package包/类
public LogWindow(PipedInputStream logInput, InstallerConfig config, int pluginCount, boolean cleanOnly) {
super("Build Log");
_fileLogEnabled = config.getFileLogging();
_suppressLog = config.getSuppressLog();
_logInput = logInput;
_pluginCount = pluginCount;
_cleanOnly = cleanOnly;
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
JPanel centerPanel = new JPanel();
BorderLayout centerLayout = new BorderLayout();
centerPanel.setLayout(centerLayout);
_logArea = new JTextArea();
_logArea.setLineWrap(true);
_logArea.setEditable(false);
if (_suppressLog) {
_logArea.setText("LOGGING SUPPRESSED");
} else {
_logArea.setText("");
}
JScrollPane logPane = new JScrollPane(_logArea);
TitledBorder pluginBorder = new TitledBorder(new LineBorder(Color.white));
pluginBorder.setTitle("Plugin Build Log");
logPane.setViewportBorder(pluginBorder);
_logArea.setColumns(toolkit.getScreenColumns() - 4);
_logArea.setRows(toolkit.getScreenRows() - 12);
centerPanel.add(logPane, BorderLayout.CENTER);
contentPane.add(centerPanel, BorderLayout.CENTER);
JPanel southPanel = new JPanel();
GridBagLayout southLayout = new GridBagLayout();
southPanel.setLayout(southLayout);
_progressBar = new JProgressBar(0, _pluginCount);
_progressBar.setValue(0);
if (_cleanOnly) {
_progressBar.setString("Cleaned 0/"+_pluginCount+" plugins");
} else {
_progressBar.setString("Built 0/"+_pluginCount+" plugins");
}
_progressBar.setStringPainted(true);
_progressBar.setSize(new Dimension(toolkit.getScreenColumns() - 4, 1));
southPanel.add(_progressBar, new GridBagConstraints(0,0,1,1,100.0,0.0
,GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 1, 0, 1), 0, 0));
_okButton = new JButton();
_okButton.setText("OK");
_okButton.setEnabled(false);
_okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
southPanel.add(_okButton, new GridBagConstraints(0,1,1,1,100.0,0.0
,GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 1, 0, 1), 0, 0));
contentPane.add(southPanel, BorderLayout.SOUTH);
setSize(toolkit.getScreenColumns(),toolkit.getScreenRows() - 6);
setLocation(0,2);
validate();
}