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; }
private JPanel makeFoundStatsBox() { JPanel foundStatsBox = new JPanel(); foundStatsBox.setLayout(new GridBagLayout()); Box labelBox = Box.createHorizontalBox(); foundStats = new JLabel(" "); labelBox.add(foundStats); historyButton = new JButton("Statistics"); historyButton.setEnabled(false); historyButton.addActionListener(this); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1.7; foundStatsBox.add(labelBox,c); c.weightx = .3; c.gridwidth = 1; foundStatsBox.add(historyButton); return foundStatsBox; }
private void initUI() { JLabel findLabel = new JLabel(NLS.str("search_dialog.open_by_name")); searchField = new JTextField(); searchField.setAlignmentX(LEFT_ALIGNMENT); searchOptions.add(caseChBox); Box box = Box.createHorizontalBox(); box.setAlignmentX(LEFT_ALIGNMENT); box.add(searchInPanel); box.add(searchOptions); findLabel.setLabelFor(searchField); searchPane.add(findLabel); searchPane.add(Box.createRigidArea(new Dimension(0, 5))); searchPane.add(searchField); searchPane.add(Box.createRigidArea(new Dimension(0, 5))); searchPane.add(box); searchPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
super(new BorderLayout()); ID_TOOLWINDOW, treeActionGroup, false); final Box toolBarBox = Box.createHorizontalBox(); toolBarBox.add(mainToolbar.getComponent()); toolBarBox.add(treeToolbar.getComponent());
public static Box wrap(JCheckBox cb) { Box b = Box.createHorizontalBox(); b.add(cb); return b; } }
public Box createBox() { switch (this) { case RIGHT: case LEFT: return Box.createHorizontalBox(); default: return Box.createVerticalBox(); } }
public void start() throws Exception { mainFrame=new JFrame("Chat demo"); mainFrame.setPreferredSize(new Dimension(600,600)); mainFrame.setBackground(Color.white); mainFrame.addWindowListener(new WindowAdapter() { Box main_box=Box.createVerticalBox(); main_box.setBackground(Color.white); Box input=Box.createHorizontalBox(); // input field Box buttons=Box.createHorizontalBox(); // for all the buttons mainFrame.add(main_box); main_box.add(Box.createVerticalStrut(10)); main_box.add(cluster); cluster.setAlignmentX(Component.LEFT_ALIGNMENT); main_box.add(Box.createVerticalStrut(10)); main_box.add(Box.createVerticalStrut(10)); txtArea.setPreferredSize(new Dimension(550, 500)); txtArea.setEditable(false); txtArea.setBackground(Color.white); main_box.add(buttons); csLabel.setPreferredSize(new Dimension(85, 30)); input.add(csLabel);
private Box makeTSurgeonScriptArea() { Box tsurgeonBox = Box.createHorizontalBox(); scriptLabel = new JLabel("Tsurgeon script: "); tsurgeonScript = new JTextArea(); tsurgeonScript.setBorder(BorderFactory.createEmptyBorder()); tsurgeonScript.setFocusTraversalKeysEnabled(true); JScrollPane scriptScroller = new JScrollPane(tsurgeonScript); scriptScroller.setBorder(BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); //scriptScroller.setEnabled(tsurgeonEnabled); tsurgeonBox.add(scriptLabel); tsurgeonBox.add(scriptScroller); //tsurgeonBox.setBorder(BorderFactory.createEtchedBorder()); return tsurgeonBox; }
/** * Constructs a new instantiated model editor from a SEM Updater. * * @param semUpdater */ public SemUpdaterEditor(SemUpdater semUpdater) { if (semUpdater == null) { throw new NullPointerException( "Bayes semUpdater must not be null."); } this.semUpdater = semUpdater; setLayout(new BorderLayout()); setName("Bayes Updater Editor"); Box b1 = Box.createHorizontalBox(); semImEditor = new SemImEditor(new SemImWrapper(semUpdater.getSemIm())); semImEditor.add(getUpdatePanel(), BorderLayout.WEST); semImEditor.setEditable(false); b1.add(semImEditor); add(b1, BorderLayout.CENTER); }
public static Box leftAlignJLabel(JLabel label) { Box box = Box.createHorizontalBox(); box.add(label); box.add(Box.createHorizontalGlue()); return box; }
private Component createGeneralTab() { JPanel panel = new JPanel(new FlowLayout(LEFT)); Box box = createHorizontalBox(); box.add(logo()); panel.add(box); return panel; }
public void initComponents() { setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); tests = new JComboBox(model.getComboModel()); tests.setMaximumRowCount(30); tests.setMaximumSize(new Dimension(250, 20)); tests.addActionListener(this); tests.setRenderer(new ListCellRenderer() { top.add(new JLabel("Choose a test:")); top.add(tests); quitButton.setAlignmentX(CENTER_ALIGNMENT); Box buttonGroups = Box.createHorizontalBox(); JPanel buttons1 = new JPanel(); buttons1.setLayout(new GridLayout(0, 1)); buttons3.add(quitButton); buttonGroups.add(buttons1); buttonGroups.add(buttons2); buttonGroups.add(buttons3);
void addComponent(String name, Component c) { Box box = Box.createHorizontalBox(); box.add(new JLabel(name)); box.add(c); add(box); if (c instanceof JCheckBox) { checkboxes.addElement(c); } else if (c instanceof JComboBox) { choices.addElement(c); } else if (c instanceof JList) { lists.addElement(c); } }
/** * 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; }
public void layout(final DefaultFormBuilder builder) { Box box = Box.createHorizontalBox(); box.add(numberSpinner); box.add(unitBox); layout(builder, box); }
description = new JLabel(); description.setHorizontalAlignment(JLabel.CENTER); final Box cancelBox = Box.createHorizontalBox(); cancelBox.add(Box.createGlue()); cancelBox.add(cancel); cancelBox.add(Box.createGlue()); cancelBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); panel.add(description); panel.add(progressBar); content.setLayout(new BorderLayout()); content.add(panel, BorderLayout.NORTH); content.add(cancelBox, BorderLayout.SOUTH);
private Box makeTSurgeonScriptArea() { Box tsurgeonBox = Box.createHorizontalBox(); scriptLabel = new JLabel("Tsurgeon script: "); tsurgeonScript = new JTextArea(); tsurgeonScript.setBorder(BorderFactory.createEmptyBorder()); tsurgeonScript.setFocusTraversalKeysEnabled(true); JScrollPane scriptScroller = new JScrollPane(tsurgeonScript); scriptScroller.setBorder(BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); //scriptScroller.setEnabled(tsurgeonEnabled); tsurgeonBox.add(scriptLabel); tsurgeonBox.add(scriptScroller); //tsurgeonBox.setBorder(BorderFactory.createEtchedBorder()); return tsurgeonBox; }
/** * Adds {@code component} to the panel and ensures it will be left-justified in the final layout. Primarily for use * with vertical box layouts. */ public JPanelBuilder addLeftJustified(final Component component) { final Box box = Box.createHorizontalBox(); box.add(component); box.add(Box.createHorizontalGlue()); return add(box); }
private void addToolbar() { ActionGroup actionGroup = createActionGroup(); mainToolbar = ActionManager.getInstance().createActionToolbar(ID, actionGroup, false); mainToolbar.setTargetComponent(this); Box toolBarBox = Box.createHorizontalBox(); toolBarBox.add(mainToolbar.getComponent()); super.setToolbar(toolBarBox); mainToolbar.getComponent().setVisible(true); }
/** * 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; }