private static Box getNewFilter() { Box filter = Box.createHorizontalBox(); FilterType[] filterTypeOptions = FilterType.values(); JComboBox filterTypes = new JComboBox(filterTypeOptions ); filterTypes.setEditable(false); filter.add(filterTypes); filter.add(Box.createHorizontalGlue()); JTextField filterInput = new JTextField(); //filterInput.setMaximumSize(new Dimension(50,50)); filterInput.setEditable(true); filter.add(filterInput); return filter; }
@NotNull protected JPanel initButtonsPanel() { progressPane = new ProgressPanel(mainWindow, false); JButton cancelButton = new JButton(NLS.str("search_dialog.cancel")); cancelButton.addActionListener(event -> dispose()); JButton openBtn = new JButton(NLS.str("search_dialog.open")); openBtn.addActionListener(event -> openSelectedItem()); getRootPane().setDefaultButton(openBtn); JPanel buttonPane = new JPanel(); buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); buttonPane.add(progressPane); buttonPane.add(Box.createRigidArea(new Dimension(5, 0))); buttonPane.add(Box.createHorizontalGlue()); buttonPane.add(openBtn); buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); buttonPane.add(cancelButton); return buttonPane; }
expirationComboBox.setMaximumSize(new Dimension(100, 32)); expirationComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { toolBar.add(copyButton); toolBar.add(expandButton); toolBar.add(Box.createHorizontalGlue()); toolBar.add(configureButton); toolBar.add(clearButton); toolBar.add(pauseButton); toolBar.add(pauseLabel); toolBar.add(Box.createHorizontalGlue()); toolBar.add(new JLabel("Clear after:")); toolBar.add(expirationComboBox);
private Box clusterDisplay() { Box b = Box.createVerticalBox(); b.setBorder(new EmptyBorder(5, 5, 5, 5)); Box b1 = Box.createHorizontalBox(); b1.add(Box.createHorizontalGlue()); b1.add(new JLabel("# Clusters = " + getNumClusters())); b.add(b1); JPanel clustersPanel = new JPanel(); clustersPanel.setLayout(new BorderLayout()); clustersPanel.add(getClusterBoxes(getNumClusters()), BorderLayout.CENTER); b.add(clustersPanel); return b; }
/** * Creates a left-aligned label. */ private static Box createLabel(String text) { Box box = Box.createHorizontalBox(); box.add(new JLabel(text)); box.add(Box.createHorizontalGlue()); return box; }
JLabel l = new JLabel(text, alignment); l.setBorder(new LineBorder(Color.RED, 2)); return l; SwingUtilities.invokeLater(new Runnable() { public void run() { JPanel p = new JPanel(new GridLayout(2,2,4,4)); p.setBackground(Color.black); p.setBorder(new EmptyBorder(4,4,4,4)); JPanel border = new JPanel(new BorderLayout()); border.add(getLabel( "Border", SwingConstants.CENTER), BorderLayout.CENTER); p.add(border); JPanel gridbag = new JPanel(new GridBagLayout()); gridbag.add(getLabel("GridBag")); p.add(gridbag); box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS )); box.add(Box.createHorizontalGlue()); box.add(getLabel("Box")); box.add(Box.createHorizontalGlue()); p.add(box);
actionHeader.add(Box.createHorizontalStrut(10)); actionHeader.add(actionHeaderLabel); actionHeader.add(Box.createHorizontalGlue()); final DevicesPopupMenu devicesPopup = new DevicesPopupMenu(); final JButton addDeviceButton = new JButton(plusIcon); add(actionHeader, BorderLayout.NORTH); controlPanel = new JPanel(new GridBagLayout()); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING, 5, 5)); buttonPanel.add(closeButton); add(buttonPanel, BorderLayout.SOUTH);
private Component createAuthorPanel() { Box box = new Box(BoxLayout.LINE_AXIS); final JLabel label = new JLabel("Author: "); final Font font = label.getFont().deriveFont(Font.BOLD); label.setFont(font); label.setAlignmentX(0.0f); box.add(label); authorLabel.setFont(font); box.add(authorLabel); box.add(Box.createHorizontalGlue()); return box; }
public PortNotesRow(String notes) { setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); notesLabel = new JLabel(notes); notesLabel.setFont(Theme.SMALL_FONT); notesLabel.setForeground(Theme.TEXT_NORMAL_COLOR); notesLabel.setBorder(BorderFactory.createEmptyBorder(TOP_PADDING, 0, BOTTOM_PADDING, 0)); add(Box.createHorizontalStrut(PortView.LABEL_WIDTH + 10)); add(this.notesLabel); add(Box.createHorizontalGlue()); setBorder(Theme.PARAMETER_NOTES_BORDER); }
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setBorder(makeBorder()); setLayout(new BorderLayout()); JPanel vertPanel = new VerticalPanel(); vertPanel.add(makeTitlePanel()); perIterationCheck = new JCheckBox(JMeterUtils.getResString("update_per_iter"), true); // $NON-NLS-1$ Box perIterationPanel = Box.createHorizontalBox(); perIterationPanel.add(perIterationCheck); perIterationPanel.add(Box.createHorizontalGlue()); vertPanel.add(perIterationPanel); add(vertPanel, BorderLayout.NORTH); add(makeParameterPanel(), BorderLayout.CENTER); }
static JComponent leftBox(final JComponent c) { final Box b = new Box(BoxLayout.X_AXIS); b.add(c); b.add(Box.createHorizontalGlue()); return b; }
private void initUI() { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); panel.add(makeDeobfuscationGroup()); panel.add(makeDecompilationGroup()); panel.add(makeEditorGroup()); panel.add(makeOtherGroup()); JPanel buttonPane = new JPanel(); buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); buttonPane.add(resetBtn); buttonPane.add(Box.createHorizontalGlue()); buttonPane.add(saveBtn); buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); buttonPane.add(cancelButton);
/** * Creates the header of the log display. */ private JComponent createHeader() { JPanel panel = new JPanel(); panel.setBackground(DisplayNodeUtils.getNodeFillColor()); panel.setLayout(new BorderLayout()); String path = TetradLogger.getInstance().getLatestFilePath(); JLabel label = new JLabel(path == null ? "Logging to console (select Setup... from Logging menu)" : " Logging to " + path); label.setFont(label.getFont().deriveFont(Font.BOLD, 12f)); label.setBackground(DisplayNodeUtils.getNodeFillColor()); label.setForeground(Color.WHITE); label.setOpaque(false); label.setBorder(new EmptyBorder(1, 2, 1, 2)); Box b = Box.createHorizontalBox(); b.add(label); b.add(Box.createHorizontalGlue()); panel.add(b, BorderLayout.CENTER); return panel; }
private Box createLabeledComponent(String label, JComponent comp) { Box box = Box.createHorizontalBox(); box.add(new JLabel(label)); box.add(Box.createHorizontalStrut(5)); box.add(comp); box.add(Box.createHorizontalGlue()); return box; }
setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); Dimension d = new Dimension(550, 30); setPreferredSize(d); setMaximumSize(d); setSize(d); deviceNameLabel = new JLabel(deviceHandler.getName()); portNumberField = new JTextField(); portNumberField.setText(String.valueOf(getPort())); portNumberField.setPreferredSize(new Dimension(70, portNumberField.getHeight())); portNumberField.setMinimumSize(new Dimension(70, portNumberField.getHeight())); add(Box.createHorizontalStrut(5)); add(clearButton); add(Box.createHorizontalGlue());
private Component createAuthorPanel() { Box box = new Box(BoxLayout.LINE_AXIS); final JLabel label = new JLabel("Author: "); final Font font = label.getFont().deriveFont(8); label.setFont(font); label.setAlignmentX(0.0f); box.add(label); authorLabel = new JLabel(""); authorLabel.setFont(font); box.add(authorLabel); box.add(Box.createHorizontalGlue()); return box; }
btnConnect = new javax.swing.JButton(); btnSendMessage = new javax.swing.JButton(); lblStatus = new javax.swing.JLabel(); consolePanel1 = new mage.server.console.ConsolePanel(); jToolBar1.add(Box.createHorizontalGlue()); jToolBar1.add(lblStatus);
/** * Returns a box in which the given component is centered horizontally. */ public static Box centerHorizontal(JComponent component) { Box row = Box.createHorizontalBox(); row.add(Box.createHorizontalGlue()); row.add(component); row.add(Box.createHorizontalGlue()); return row; }
selectGraphPane.setPreferredSize(new Dimension(500, 500)); JPanel buttonPane = new JPanel(); buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); buttonPane.add(Box.createHorizontalGlue()); buttonPane.add(apply); buttonPane.add(cancel);
private JComponent editor() { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); Box b1 = Box.createVerticalBox(); Box b2 = Box.createHorizontalBox(); b2.add(new JLabel("<html>" + "The input dataset will be sampled with replacement to create a new" + "<br>dataset with the number of samples entered below." + "<br>The editable default sample size is 100." + "</html>")); Box b7 = Box.createHorizontalBox(); b7.add(Box.createHorizontalGlue()); b7.add(new JLabel("<html>" + "<i>Sample size: </i>" + "</html>")); b7.add(sampleSizeField); b1.add(Box.createVerticalStrut(5)); b1.add(b7); b1.add(Box.createHorizontalGlue()); panel.add(b1, BorderLayout.CENTER);