private JXStatusBar createBar() { bar = new JXStatusBar(); bar.putClientProperty(BasicStatusBarUI.AUTO_ADD_SEPARATOR, false); statusLabel = new JLabel(""); bar.add(statusLabel, MainFrame.getStatusLabelConstraint()); // Fixed width of 100 with no inserts JSeparator sep = new JSeparator(JSeparator.VERTICAL); bar.add(sep, MainFrame.getSeparatorConstraint()); progressLabel = new JLabel(""); progressLabel.setHorizontalAlignment(SwingConstants.RIGHT); progressLabel.setVisible(false); bar.add(progressLabel); pbar = new JXProgressBar(); bar.add(pbar, MainFrame.getProgressBarConstraint()); // Fill with no inserts - will use remaining space pbar.setVisible(false); bar.setVisible(false); return bar; }
operatorLabel.setToolTipText("Right click for log in"); addLoginMenu(operatorLabel); bar.add(operatorLabel); bar.add(new JSeparator(JSeparator.VERTICAL), getSeparatorConstraint()); getTestStation().getTestProject().getAuthentication().addPropertyChangeListener(this); bar.add(statusLabel, getStatusLabelConstraint()); // Fixed width of 100 with no inserts bar.add(new JSeparator(JSeparator.VERTICAL), getSeparatorConstraint()); progressLabel = new JLabel(""); progressLabel.setHorizontalAlignment(SwingConstants.RIGHT); progressLabel.setVisible(false); bar.add(progressLabel); pbar = new JXProgressBar(); bar.add(pbar, getProgressBarConstraint()); // Fill with no inserts - will use remaining space pbar.setBorder(null); pbar.setVisible(false); bar.add(new JSeparator(JSeparator.VERTICAL), getSeparatorConstraint()); freeDiskLabel = new JLabel("D: x.xxx GB "); try { bar.add(freeDiskLabel); Thread t = new Thread(new Runnable() { @Override bar.add(new JSeparator(JSeparator.VERTICAL), getSeparatorConstraint()); freeMemoryLabel = new JLabel("M: xxxx MB ");
statusBar.add(statusLabel); statusBar.add(Box.createHorizontalStrut(20)); } else { final ServiceLoader<InformationPanelDescriptor> panelsLoaders = final InformationPanelLabel plugableRightPanelLabel = new InformationPanelLabel(rightInformationPanel, panel); statusBar.add(plugableRightPanelLabel); statusBar.add(Box.createHorizontalStrut(20));
public static JXStatusBar createStatusBar(final JComponent comp) { final JXStatusBar statusBar = new JXStatusBar(); statusBar.setUI(new MetalStatusBarUI()); statusBar.putClientProperty(BasicStatusBarUI.AUTO_ADD_SEPARATOR, false); statusBar.setBackground(WidgetUtils.BG_COLOR_DARKEST); final MatteBorder outerBorder = new MatteBorder(1, 0, 0, 0, WidgetUtils.BG_COLOR_LESS_DARK); final EmptyBorder innerBorder = new EmptyBorder(2, 2, 2, 2); statusBar.setBorder(new CompoundBorder(outerBorder, innerBorder)); final JXStatusBar.Constraint c1 = new JXStatusBar.Constraint(JXStatusBar.Constraint.ResizeBehavior.FILL); statusBar.add(comp, c1); return statusBar; }