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

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

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

Box.setBorder介绍

暂无

代码示例

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

displayPrefs.setBorder(BorderFactory.createTitledBorder("Display"));
JPanel displayOptions = new JPanel();
treeDisplayPrefs.setBorder(BorderFactory.createTitledBorder("Tree Display"));
JPanel treeDisplayOptions = new JPanel();
treeDisplayOptions.setLayout(new GridLayout(4,2));

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

private void initComponents() {
  JPanel buttonPanel = new JPanel();
  Box buttonBox = new Box(BoxLayout.X_AXIS);
  cardPanel = new JPanel();
  cardPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
  cardLayout = new CardLayout();
  cardPanel.setLayout(cardLayout);
  backButton = new JButton("Back");
  nextButton = new JButton("Next");
  finishButton = new JButton("Finish");
  cancelButton = new JButton("Cancel");
  backButton.addActionListener(controller);
  nextButton.addActionListener(controller);
  finishButton.addActionListener(controller);
  cancelButton.addActionListener(controller);
  buttonPanel.setLayout(new BorderLayout());
  buttonPanel.add(new JSeparator(), BorderLayout.NORTH);
  buttonBox.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
  buttonBox.add(backButton);
  buttonBox.add(Box.createHorizontalStrut(10));
  buttonBox.add(nextButton);
  buttonBox.add(Box.createHorizontalStrut(30));
  buttonBox.add(finishButton);
  buttonBox.add(Box.createHorizontalStrut(10));
  buttonBox.add(cancelButton);
  buttonPanel.add(buttonBox, java.awt.BorderLayout.EAST);
  getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);
  getContentPane().add(new JScrollPane(cardPanel), java.awt.BorderLayout.CENTER);
}

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

cancelBox.add(cancel);
cancelBox.add(Box.createGlue());
cancelBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));

代码示例来源:origin: RaiMan/SikuliX2

defaultButton = new Button("Close");
buttons.add(defaultButton);
buttons.setBorder(BorderFactory.createEmptyBorder(15,5,5,5));

代码示例来源:origin: edu.stanford.protege/org.coode.owlviz

protected JComponent createUI() {
  leftToRightButton = new JRadioButton("Left to Right", true);
  topToBottomButton = new JRadioButton("Top To Bottom", false);
  ButtonGroup buttonGroup = new ButtonGroup();
  buttonGroup.add(leftToRightButton);
  buttonGroup.add(topToBottomButton);
  Box box = new Box(BoxLayout.Y_AXIS);
  box.add(leftToRightButton);
  box.add(topToBottomButton);
  box.setBorder(BorderFactory.createTitledBorder("Layout Direction"));
  return box;
}

代码示例来源:origin: com.fifesoft.rtext/fife.common

/**
 * Sets the label to use for the font style checkbox area.
 *
 * @param text The label for the font style checkbox area.
 * @see #getFontStyleLabel
 */
public void setFontStyleLabel(String text) {
  styleLabel = text;
  fontFormatPanel.setBorder(
    BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder(styleLabel),
            UIUtil.getEmpty5Border()));
}

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

private Box getParamsPanel() {
  Box b2 = Box.createVerticalBox();
  b2.add(getIndTestParamBox());
  b2.setBorder(new TitledBorder("Parameters"));
  return b2;
}

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

private Box getParamsPanel() {
  Box b2 = Box.createVerticalBox();
  b2.add(getIndTestParamBox());
  b2.setBorder(new TitledBorder("Parameters"));
  return b2;
}

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

private Box getParamsPanel() {
  Box b2 = Box.createVerticalBox();
  b2.add(getIndTestParamBox());
  b2.setBorder(new TitledBorder("Parameters"));
  return b2;
}

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

private Box getParamsPanel() {
  Box b2 = Box.createVerticalBox();
  b2.add(getIndTestParamBox());
  b2.setBorder(new TitledBorder("Parameters"));
  return b2;
}

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

private Box getParamsPanel() {
  Box b2 = Box.createVerticalBox();
  b2.add(getIndTestParamBox());
  b2.setBorder(new TitledBorder("Parameters"));
  return b2;
}

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

private Box createButtonBar() {
  final Box controllerBox = Box.createHorizontalBox();
  controllerBox.setBorder(new EmptyBorder(5, 0, 5, 0));
  final CloseAction closeAction = new CloseAction();
  btnOK = createButton("ok", closeAction);
  final JButton btnCancel = createButton("cancel", closeAction);
  controllerBox.add(Box.createHorizontalGlue());
  controllerBox.add(btnOK);
  controllerBox.add(Box.createHorizontalGlue());
  controllerBox.add(btnCancel);
  controllerBox.add(Box.createHorizontalGlue());
  return controllerBox;
}

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

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

代码示例来源:origin: de.sciss/prefuse-core

/**
 * @see java.awt.Component#setForeground(java.awt.Color)
 */
public void setForeground(Color fg) {
  super.setForeground(fg);
  if ( m_queryF  != null ) {
    m_queryF.setForeground(fg);
    m_queryF.setCaretColor(fg);
  }
  if ( m_resultL != null ) m_resultL.setForeground(fg);
  if ( m_searchL != null ) m_searchL.setForeground(fg);
  if ( m_sbox != null && m_showBorder )
    m_sbox.setBorder(BorderFactory.createLineBorder(fg));
}

代码示例来源:origin: com.numdata/numdata-swing

/**
 * Create tool bar component to which buttons will be added.
 *
 * @return {@link JComponent} to use as tool bar.
 */
protected JComponent createToolBar()
{
  final Box result = new Box( BoxLayout.X_AXIS );
  result.setBorder( BorderFactory.createMatteBorder( 1, 1, 0, 1, Color.GRAY ) );
  return result;
}

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

private Box createButtonBar() {
  final Box controllerBox = Box.createHorizontalBox();
  controllerBox.setBorder(new EmptyBorder(5, 0, 5, 0));
  final CloseAction closeAction = new CloseAction();
  controllerBox.add(Box.createHorizontalGlue());
  btnSkip = createButton(key("cancel"), null, closeAction);
  btnRestore = createButton(key("open"), key("open.tooltip"), closeAction);
  controllerBox.add(btnRestore);
  controllerBox.add(Box.createHorizontalStrut(10));
  controllerBox.add(btnSkip);
  controllerBox.add(Box.createHorizontalStrut(10));
  return controllerBox;
}

代码示例来源:origin: org.protege/protege-editor-core-application

private Component createInfoBox() {
  Box infoBox = new Box(BoxLayout.PAGE_AXIS);
  infoBox.setBorder(ComponentFactory.createTitledBorder("Plugin info"));
  infoBox.add(Box.createRigidArea(new Dimension(0, 10)));
  infoBox.add(createAuthorPanel());
  infoBox.add(Box.createRigidArea(new Dimension(0, 10)));
  infoBox.add(createLicensePanel());
  infoBox.add(Box.createRigidArea(new Dimension(0, 20)));
  infoBox.add(createDocPanel());
  return infoBox;
}

代码示例来源:origin: com.numdata/numdata-swing

/**
 * Construct panel to place buttons on.
 *
 * @return Button panel component.
 */
@NotNull
protected Container createButtonBar()
{
  final Box result = new Box( BoxLayout.X_AXIS );
  result.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createMatteBorder( 1, 0, 0, 0, Color.GRAY ), BorderFactory.createEmptyBorder( BUTTON_BAR_INSET, BUTTON_BAR_INSET, BUTTON_BAR_INSET, BUTTON_BAR_INSET ) ) );
  result.add( Box.createGlue() );
  add( result, BorderLayout.SOUTH );
  return result;
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application

private Component createInfoBox() {
  Box infoBox = new Box(BoxLayout.PAGE_AXIS);
  infoBox.setBorder(ComponentFactory.createTitledBorder("Plugin info"));
  infoBox.add(Box.createRigidArea(new Dimension(0, 10)));
  infoBox.add(createAuthorPanel());
  infoBox.add(Box.createRigidArea(new Dimension(0, 10)));
  infoBox.add(createLicensePanel());
  infoBox.add(Box.createRigidArea(new Dimension(0, 20)));
  infoBox.add(createDocPanel());
  return infoBox;
}

代码示例来源:origin: icza/scelight

@Override
  public void actionPerformed( final ActionEvent event ) {
    userBox.setBorder( userCheckBox.isSelected() ? BorderFactory.createLoweredBevelBorder() : BorderFactory.createRaisedBevelBorder() );
  }
} );

相关文章