final JLabel mainLabelComp = ProgressHandleFactory.createMainLabelComponent (handle); Mutex.EVENT.readAccess( new Runnable() { @Override
JLabel extractMainLabel() { return ProgressHandleFactory.createMainLabelComponent(handle); } }
/** * Get the task title component for use in custom dialogs, the task won't * show in the progress bar anymore. The text of the label is changed by calls to handle's <code>setDisplayName()</code> method. * @return the component to use in custom UI. * @since org.netbeans.api.progress 1.8 */ public static JLabel createMainLabelComponent(AggregateProgressHandle handle) { return ProgressHandleFactory.createMainLabelComponent(getProgressHandle(handle)); }
private JPanel createProgressPanel(ProgressHandle progressHandle) { JPanel panel = preparePanel(); JComponent progressComponent = ProgressHandleFactory.createProgressComponent(progressHandle); JLabel progressLabel = ProgressHandleFactory.createMainLabelComponent(progressHandle); GridBagConstraints constraints = new GridBagConstraints(); constraints.weightx = 0.5; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.insets = new Insets(0, 40, 0, 40); panel.add(progressLabel, constraints); constraints = new GridBagConstraints(); constraints.gridx = 0; constraints.gridy = 1; constraints.weightx = 0.5; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.insets = new Insets(0, 40, 20, 40); panel.add(progressComponent, constraints); JScrollPane scrlPane = new JScrollPane(); scrlPane.setViewportView(panel); JPanel pnl = new JPanel(); pnl.setLayout(new BorderLayout()); pnl.add(scrlPane, BorderLayout.CENTER); return pnl; }
handle = ProgressHandleFactory.createHandle(Bundle.MSG_LaunchingApplication()); JComponent pc = ProgressHandleFactory.createProgressComponent(handle); JLabel ml = ProgressHandleFactory.createMainLabelComponent(handle);