javax.swing.Box.createVerticalBox()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(309)

本文整理了Java中javax.swing.Box.createVerticalBox()方法的一些代码示例,展示了Box.createVerticalBox()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Box.createVerticalBox()方法的具体详情如下:
包路径:javax.swing.Box
类名称:Box
方法名:createVerticalBox

Box.createVerticalBox介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

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);

代码示例来源:origin: freeplane/freeplane

public Box createBox() {
  switch (this) {
    case RIGHT:
    case LEFT:
      return Box.createHorizontalBox();
    default:
      return Box.createVerticalBox();
  }
}

代码示例来源:origin: com.metsci.glimpse/glimpse-docking

public static Box createVerticalBox( Component... cs )
{
  Box box = Box.createVerticalBox( );
  for ( Component c : cs )
    box.add( c );
  return box;
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

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);
}

代码示例来源:origin: cmu-phil/tetrad

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;
}

代码示例来源:origin: com.googlecode.jannocessor/jannocessor-ui

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;
}

代码示例来源:origin: net.sf.jt400/jt400

/**
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);

}

代码示例来源:origin: cmu-phil/tetrad

/**
 * 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;
}

代码示例来源:origin: com.fossgalaxy.games/fireworks

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);
}

代码示例来源:origin: wildfly/wildfly

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));

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

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);
  }
}

代码示例来源:origin: cmu-phil/tetrad

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;
}

代码示例来源:origin: freeplane/freeplane

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);
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

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;
  }
}

代码示例来源:origin: lbalazscs/Pixelitor

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);
}

代码示例来源:origin: apache/pdfbox

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);

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

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);
}

代码示例来源:origin: cmu-phil/tetrad

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;
}

代码示例来源:origin: fr.ifremer/isis-fish

/**
 * 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();
}

代码示例来源:origin: info.aduna.commons/aduna-commons-swing

/**
 * 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;
}

相关文章