progressBar.setAlignmentX(Component.LEFT_ALIGNMENT); progressBar.setPreferredSize(new Dimension(Short.MAX_VALUE, 20)); progressBar.setMaximumSize(new Dimension(Short.MAX_VALUE, 20));
JProgressBar pb = new JProgressBar (); pb.setOrientation (JProgressBar.HORIZONTAL); pb.setAlignmentX(0.5f); pb.setAlignmentY(0.5f); pb.setString ("0"); // NOI18N
/**************************************************************************/ private void init(String initLabel) { panel = new JPanel(); panel.setLayout(null); panel.setPreferredSize(new Dimension(400, 100)); progressLabel = new JLabel(initLabel); progressLabel.setFont(new java.awt.Font("dialog", java.awt.Font.BOLD, 12)); progressLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); progressLabel.setForeground(new java.awt.Color(0, 0, 156)); progressLabel.setBounds(30, 20, 340, 20); panel.add(progressLabel); progressBar = new JProgressBar(0, maxSteps); progressBar.setStringPainted(true); progressLabel.setLabelFor(progressBar); progressBar.setAlignmentX(CENTER_ALIGNMENT); progressBar.getAccessibleContext().setAccessibleName("SwingSet loading progress"); progressBar.setBounds(30, 40, 340, 20); panel.add(progressBar); // show the frame this.setContentPane(panel); this.pack(); this.setVisible(true); WindowUtils.centerWindow(this); setState(initLabel, 0); } /**************************************************************************/
this.overallProgressBar.setAlignmentX(0.5f); this.overallProgressBar.setStringPainted(true); subpanel.add(this.overallProgressBar);
totalProgressBar.setAlignmentX(LEFT_ALIGNMENT); currentFileLabel = new JLabel(job.getStatusString()); currentFileLabel.setAlignmentX(LEFT_ALIGNMENT);
@Override public void run() { setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); add(statusLabel); add(progressBar); add(cancelButton); statusLabel.setAlignmentX(CENTER_ALIGNMENT); progressBar.setAlignmentX(CENTER_ALIGNMENT); cancelButton.setAlignmentX(CENTER_ALIGNMENT); pack(); setSize(300, getHeight()); setLocationRelativeTo(MainFrame.getInstance()); setResizable(false); setModal(true);// Why was this set to false before? try { setVisible(true); } catch (Throwable e) { AnalyzingDialog.this.project.getGuiCallback().showMessageDialog("ERROR DURING ANALYSIS:\n\n" + e.getClass().getSimpleName() + ": " + e.getMessage()); } } });