final JPanel prefPanel = new JPanel(); prefPanel.setLayout(new GridBagLayout()); Box displayPrefs = Box.createVerticalBox(); displayPrefs.setBorder(BorderFactory.createTitledBorder("Display")); JPanel displayOptions = new JPanel(); JLabel historyLabel = new JLabel("Recent matches length: "); final JTextField historySizeField = new JTextField(Integer.toString(Preferences.getHistorySize())); displayOptions.add(historySizeField); JLabel maxMatchesLabel = new JLabel("Max displayed trees: "); final JTextField maxMatchesSizeField = new JTextField(Integer.toString(Preferences.getMaxMatches())); displayOptions.add(maxMatchesSizeField); Box treeDisplayPrefs = Box.createVerticalBox(); treeDisplayPrefs.setBorder(BorderFactory.createTitledBorder("Tree Display")); JPanel treeDisplayOptions = new JPanel(); treeDisplayOptions.setLayout(new GridLayout(4,2)); JLabel fontName = new JLabel("Font: "); treeDisplayPrefs.add(treeDisplayOptions);
public Box createBox() { switch (this) { case RIGHT: case LEFT: return Box.createHorizontalBox(); default: return Box.createVerticalBox(); } }
public static Box createVerticalBox( Component... cs ) { Box box = Box.createVerticalBox( ); for ( Component c : cs ) box.add( c ); return box; }
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout()); setBorder(makeBorder()); Box box = Box.createVerticalBox(); box.add(makeTitlePanel()); box.add(createScopePanel(true, true, true)); xml.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils .getResString("xpath_assertion_option"))); //$NON-NLS-1$ box.add(xml); box.add(getFragment); box.add(makeParameterPanel()); add(box, BorderLayout.NORTH); }
private JPanel getParamsPanel() { JPanel paramsPanel = new JPanel(); Box b2 = Box.createVerticalBox(); JComponent indTestParamBox = getIndTestParamBox(); if (indTestParamBox != null) { b2.add(indTestParamBox); } paramsPanel.add(b2); paramsPanel.setBorder(new TitledBorder("Parameters")); return paramsPanel; }
private JComponent createOutput(String title, String content) { editor = new JEditorPane(); JScrollPane scroll = new JScrollPane(editor, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scroll.setMinimumSize(new Dimension(100, 100)); editor.setContentType("text/java_output"); editor.setEditable(false); editor.setText(content); editor.addKeyListener(keyListener); JLabel header = new JLabel(title); Box box = Box.createVerticalBox(); box.add(header); box.add(scroll); return box; }
/** Builds the panel GUI components and sets up connections between the components by using listeners. **/ protected void setupPane() { super.setupPane(); clause_ = new SQLQueryClause(5); Box overallBox = Box.createVerticalBox(); overallBox.add(fields_); overallBox.add(new LabelledComponent("DBQUERY_LABEL_CLAUSE_GROUP", new ScrollingTextPane(clause_))); setLayout(new BorderLayout()); add("Center", overallBox); }
/** * Creates the select variable button. */ private JComponent createSelectVariableButton() { Box box = Box.createVerticalBox(); JButton selectVariable = new JButton(">"); selectVariable.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Node node = (Node) variableList.getSelectedValue(); if (node != null) { insertSymbol(node.getName()); } } }); box.add(Box.createVerticalStrut(50)); box.add(selectVariable); box.add(Box.createVerticalGlue()); return box; }
public static void main(String[] args) { JFrame frame = new JFrame(); frame.setPreferredSize(new Dimension(800, 600)); JComponent handView = Box.createHorizontalBox(); for (int i=0; i<5; i++) { JComponent cardView = Box.createVerticalBox(); Box box = Box.createHorizontalBox(); box.add(buildIndicators()); box.add(buildCard()); box.add(buildIndicators()); cardView.add(box); Box buttons = Box.createHorizontalBox(); buttons.add(new JButton("Colour")); buttons.add(new JButton("Value")); cardView.add(buttons); handView.add(cardView); } frame.add(handView); frame.pack(); frame.setVisible(true); }
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)); main_box.add(users_label); main_box.add(Box.createVerticalStrut(10));
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout()); setBorder(makeBorder()); Box box = Box.createVerticalBox(); box.add(makeTitlePanel()); errorPanel = new OnErrorPanel(); box.add(errorPanel); add(box, BorderLayout.NORTH); } }
private JPanel getParamsPanel() { JPanel paramsPanel = new JPanel(); Box b2 = Box.createVerticalBox(); JComponent indTestParamBox = getIndTestParamBox(); if (indTestParamBox != null) { b2.add(indTestParamBox); } paramsPanel.add(b2); paramsPanel.setBorder(new TitledBorder("Parameters")); return paramsPanel; }
public void actionPerformed(final ActionEvent arg0) { Box box = Box.createVerticalBox(); final String about1 = TextUtils.getText("LatexInsertLatexAction.msg1"); box.add(new JLabel(about1)); addUriWithoutTitle(box, "LaTeX_in_freeplane_url"); final String about2 = TextUtils.getText("LatexInsertLatexAction.msg2"); box.add(new JLabel(about2)); JOptionPane.showMessageDialog(UITools.getCurrentRootComponent(), box, TextUtils .getText("LatexInsertLatexAction.text"), JOptionPane.INFORMATION_MESSAGE); }
private Box createInfoPanel() { final Box pnl = Box.createVerticalBox(); pnl.add(new JSeparator()); pnl.add(_descriptionLbl); pnl.add(new JSeparator()); pnl.add(new MultipleLineLabel(i18n.INSTRUCTIONS)); return pnl; } }
private void initLeftVerticalBox(Convolve filter) { Box box = Box.createVerticalBox(); addTextFieldsPanel(box); addNormalizeButton(box); addTryButton(box); box.add(Box.createVerticalStrut(20)); addConvolveMethodSelector(filter, box); box.setMaximumSize(box.getPreferredSize()); box.setAlignmentY(Component.TOP_ALIGNMENT); add(box); }
panel.setPreferredSize(new Dimension(300, 500)); JLabel flagLabel = new JLabel(flagHeader); flagLabel.setAlignmentX(Component.CENTER_ALIGNMENT); flagLabel.setFont(new Font(Font.MONOSPACED, Font.BOLD, 30)); JPanel flagLabelPanel = new JPanel(); flagLabelPanel.setAlignmentX(Component.LEFT_ALIGNMENT); flagLabelPanel.add(flagLabel); JLabel flagValueLabel = new JLabel(flagValue); flagValueLabel.setAlignmentX(Component.LEFT_ALIGNMENT); flagValueLabel.setFont(new Font(Font.MONOSPACED, Font.BOLD, 20)); scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT); Box box = Box.createVerticalBox(); box.add(flagValueLabel); box.add(scrollPane); box.setAlignmentX(Component.LEFT_ALIGNMENT);
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout()); setBorder(makeBorder()); Box box = Box.createVerticalBox(); box.add(makeTitlePanel()); box.add(createSignaturePanel()); box.add(createSignerPanel()); box.add(createMessagePositionPanel()); add(box, BorderLayout.NORTH); }
private JPanel getParamsPanel() { JPanel paramsPanel = new JPanel(); Box b2 = Box.createVerticalBox(); JComponent indTestParamBox = getIndTestParamBox(); if (indTestParamBox != null) { b2.add(indTestParamBox); } paramsPanel.add(b2); paramsPanel.setBorder(new TitledBorder("Parameters")); return paramsPanel; }
/** * Affiche une boite de dialogue modale permettant de modifier l'expression * R. * * @param rCall r instruction to edit * @return user edited r instruction */ protected String editRInstruction(String rCall) { JLabel label = new JLabel(t("Modifier le code R envoyé si vous le souhaitez")); JTextPane text = new JTextPane(); text.setText(rCall); text.setSize(400, 400); text.setPreferredSize(text.getSize()); Box box = Box.createVerticalBox(); box.add(label); box.add(new JScrollPane(text)); JOptionPane.showMessageDialog(null, box, t("R modif"), JOptionPane.QUESTION_MESSAGE); return text.getText(); }
/** * Returns a box in which the given component is centered vertically. */ public static Box centerVertical(JComponent component) { Box column = Box.createVerticalBox(); column.add(Box.createVerticalGlue()); column.add(component); column.add(Box.createVerticalGlue()); return column; }