1 19 20 21 package org.netbeans.modules.autoupdate.catalog; 22 23 import java.awt.BorderLayout ; 24 import javax.swing.JComponent ; 25 import javax.swing.SwingUtilities ; 26 import org.netbeans.api.progress.ProgressHandle; 27 import org.netbeans.api.progress.ProgressHandleFactory; 28 29 32 public class ModuleUpdaterProgress extends javax.swing.JPanel { 33 34 private JComponent progress; 35 private ProgressHandle handle; 36 37 40 public ModuleUpdaterProgress(ProgressHandle handle) { 41 progress = ProgressHandleFactory.createProgressComponent(handle); 42 this.handle = handle; 43 initComponents(); 44 } 45 46 51 private void initComponents() { 53 java.awt.GridBagConstraints gridBagConstraints; 54 55 innerPanel = new javax.swing.JPanel (); 56 message = ProgressHandleFactory.createDetailLabelComponent (handle); 57 58 setLayout(new java.awt.GridBagLayout ()); 59 60 setBorder(javax.swing.BorderFactory.createEmptyBorder(11, 11, 11, 11)); 61 innerPanel.setLayout(new java.awt.BorderLayout ()); 62 63 innerPanel.add(progress, BorderLayout.CENTER); 64 65 gridBagConstraints = new java.awt.GridBagConstraints (); 66 gridBagConstraints.gridx = 0; 67 gridBagConstraints.gridy = 1; 68 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 69 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 70 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 71 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 72 gridBagConstraints.weightx = 1.0; 73 add(innerPanel, gridBagConstraints); 74 75 message.setLabelFor(innerPanel); 76 message.setPreferredSize(new java.awt.Dimension (350, 20)); 77 gridBagConstraints = new java.awt.GridBagConstraints (); 78 gridBagConstraints.gridx = 0; 79 gridBagConstraints.gridy = 0; 80 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 81 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 82 gridBagConstraints.insets = new java.awt.Insets (0, 0, 6, 0); 83 add(message, gridBagConstraints); 84 85 } 87 88 public javax.swing.JPanel innerPanel; 90 public javax.swing.JLabel message; 91 93 } 94 | Popular Tags |