1 19 20 package org.netbeans.modules.web.monitor.client; 21 22 import javax.swing.SwingUtilities ; 23 24 import org.openide.util.NbBundle; 25 import org.openide.util.Utilities; 26 import org.openide.windows.WindowManager; 27 28 33 public class ProgressMonitor extends javax.swing.JDialog { 34 35 36 39 public ProgressMonitor() { 40 super(WindowManager.getDefault().getMainWindow(), true); 41 setModal(true); 42 initComponents(); 43 setBounds(Utilities.findCenterBounds(getSize())); 44 setLocationRelativeTo(WindowManager.getDefault().getMainWindow()); 45 setTitle(NbBundle.getMessage(ProgressMonitor.class, "LBL_Delete_Progress_Monitor")); 46 } 47 48 51 public void close() { 52 progressBar.setValue(progressBar.getMaximum()); 53 setVisible(false); 54 dispose(); 55 } 56 57 62 public void setValue(int value) { 63 progressBar.setValue(value); 64 } 65 66 71 private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; 73 74 progressBar = new javax.swing.JProgressBar (); 75 label = new javax.swing.JLabel (); 76 note = new javax.swing.JLabel (); 77 78 getContentPane().setLayout(new java.awt.GridBagLayout ()); 79 80 setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); 81 setResizable(false); 82 progressBar.setMinimumSize(new java.awt.Dimension (148, 14)); 83 gridBagConstraints = new java.awt.GridBagConstraints (); 84 gridBagConstraints.gridx = 1; 85 gridBagConstraints.gridy = 1; 86 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 87 gridBagConstraints.insets = new java.awt.Insets (0, 5, 0, 5); 88 getContentPane().add(progressBar, gridBagConstraints); 89 90 label.setText(NbBundle.getMessage (ProgressMonitor.class, "MSG_Delete_Progress_Monitor")); 91 gridBagConstraints = new java.awt.GridBagConstraints (); 92 gridBagConstraints.gridx = 1; 93 gridBagConstraints.gridy = 0; 94 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 95 gridBagConstraints.insets = new java.awt.Insets (10, 5, 10, 5); 96 getContentPane().add(label, gridBagConstraints); 97 98 note.setFont(new java.awt.Font ("Dialog", 0, 12)); 99 note.setText(NbBundle.getMessage (ProgressMonitor.class, "MSG_Delete_Progress_Monitor_note")); 100 gridBagConstraints = new java.awt.GridBagConstraints (); 101 gridBagConstraints.gridx = 1; 102 gridBagConstraints.gridy = 2; 103 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 104 gridBagConstraints.insets = new java.awt.Insets (4, 5, 5, 5); 105 getContentPane().add(note, gridBagConstraints); 106 107 pack(); 108 } 110 private javax.swing.JLabel label; 112 private javax.swing.JLabel note; 113 private javax.swing.JProgressBar progressBar; 114 116 } 117 | Popular Tags |